Repository navigation
sprite images missing on > 2.0 scale factors - #843
Conversation
|
So this also affects the Bright style's water fill pattern. Clearly one approach would be to create Since we're talking first about an iOS beta, we could just do the Another approach would be to upsample |
This is the correct approach IMHO. It should support styles without 3x assets (or any particular Nx), picking the best one and scaling it appropriately. |
|
If the image data is correctly copied to GPU and UV mapping correctly done, icons should be rendered using whatever interpolation algorithm(GL_LINEAR/GL_NEAREST) is set up. |
|
When I last looked at this, the problem was related to the |
|
This could be a bug in SpriteAtlas::copy, which copies raw pixels from Sprite.raster to to SpriteAtlas.data. It just copies raw pixels without taking into account the difference in pixelRatio between the Sprite and the SpriteAtlas. |
|
SpriteAtlas has a method resize that can be used to make the pixelRatio same as Sprite.pixelRatio. If one does that this bug goes away for iPhone 6 plus (ratio > 2). |
|
I added this in Map::prepare to verify that copy code wasn't correctly handling copying between Sprite to SpriteAtlas. . |
|
I wonder if this is also the cause of #888 |
|
This turned out to be a combination of a few issues:
|
|
I have an older git repo. Therein SpriteAtlas::bind uses GL_CLAMP_TO_EDGE. The latest repo uses GL_REPEAT. MBGL_CHECK_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); |
|
Hmm I will take a look into this. Android can have some very unusual pixel ratios. Your analysis seems to line up with the behaviour I had been seeing. |
|
Currently I don't get any POI icons at all on my HTC One which is 3.0x. |
194c0d2 to
0234672
Compare
- OpenGL ES 2 doesn't allow NPOT textures with wrap-around - The Sprite object reported the map's pixelRatio, even though it loaded @2x assets - Copying icons from the sprite into the atlas now uses bilinear scaling to scale up to the actual size
0234672 to
48c55af
Compare
sprite images missing on > 2.0 scale factors
Carryover from #621. Sprites are falling down on iPhone 6 Plus and not sure why. We are doing things right AFAICT with
1x/2xsprite sheets etc. by just looking forscale > 1and using@2xin that case. But perhaps something in the point shader is making the wrong assumption in some math.This can easily be tested in iPhone 6 Plus simulator.
/cc @ljbade in case this is also an issue on Android hidpi.