Shader stop working when using packed texture

Hello,

I have this Sprite shader that works great. I decided to packed the texture inside a SpriteAtlas in order to enjoy better format/compression. But even with “CanUseSpriteAtlas”=“True” the shader has stopped working.

Is there something special I should do ?

Thanks

If your shader makes use of the 0.0 to 1.0 UV range for something, expecting those values to be the corners of the sprite mesh, then it won’t work with an atlased sprite. When using a SpriteAtlas, the sprite is packed into a larger texture, which means the sprite mesh’s UVs are no longer guaranteed to be in that nice 0.0 to 1.0 range from one edge to the other. The only real solution is not to use a sprite atlas for shaders that need that strict UV range.

Hello,

Thanks for the explanation, at least I have a beginning of understanding of what is going on. Is there a way to know/compute the actual range and then maybe compute a scale factor to applied in the shader ?

Sadly, no.