-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Increase sprite atlas capacity #489
Comments
background-image: #394 |
After some tinkering, I've found the issue. In this example, the water pattern is sized at 510x510, and shows on both browser and native. However, the forest pattern (greenish one over land) is 510x511, and does not show on native. cc/ @jfirebaugh @incanus |
Does it look ok in the sprite? |
The sprite atlas has a hard-coded size of 512x512, and images are padded by 2 pixels on a side, so 510 is indeed the current magic number. In order to fix this properly we need to auto-grow the atlas size when it overflows. A quick fix would be double or triple the current dimensions. |
👍 for tripling the dimensions. |
There are GL texture implications here to which @kkaefer or @adam-mapbox could likely speak. We need to go with a safe, conservative max texture size across iOS and Android. |
I've since learned that we can't increase the size beyond 1024x1024 without changing how sprite alas coordinates are packed in vertex attributes. (Icons are aligned to multiples of 4 pixels, each coordinate is divided by 4, packed into a single byte, and multiplied by 4 in the shader.) |
#3703 increases the SpriteAtlas size to 1024×1024. |
I'm recommending users to create sprites that are If we want to take textures serious we need bigger sprite atlas sizes. 1024 x 1024 is not enough space. Even in the tutorial, the textures feel too small (ideally each individual fill texture is 512 x 512 to reduce how much repetition is apparent to the user. |
"fill-image" fails when image >510px on either dimension
The text was updated successfully, but these errors were encountered: