mousebird-consulting-inc / WhirlyGlobe

WhirlyGlobe Development
Other
827 stars 253 forks source link

Texture drawing artifacts #1597

Open akovalov opened 9 months ago

akovalov commented 9 months ago

The texture is drawn in a different way in some areas which looks like on "joining" of the texture image. The texture in those small areas looks like zoomed a bit and rotated.

The texture image is 1000x1000 px and added as

let texture = maplyVC.addTexture(image, desc: [
                kMaplyTexWrapX: true,
                kMaplyTexWrapY: true
            ], mode: .any)

and the polygons are added as

var styleDesc: [AnyHashable: Any] = [
            kMaplyFilled: true,
            kMaplySelectable: false,
            kMaplyVecWidth: 1,
            kMaplyEnable: false,
            kMaplyVecTexScaleX: 20,
            kMaplyVecTexScaleY: 20,
            kMaplyVecTexture: texture
        ]
viewC.addVectors(vecObjs, desc: styleDesc, mode: .current)

Do you have an idea why those artifacts appear and how can be fixed? Anything in AutoTester that can be related (except TextureVectorTestCase)?

Simulator Screenshot - iPad Air (5th generation) - 2023-09-18 at 14 01 57

sjg-wdw commented 8 months ago

Hard to say why that's happening. I'd suggest looking at at the geometry in the Metal debugging tools to se ehow it's tessellated and check the texture coordinates to see if they're getting too large.