Hey, sorry wasn’t clear. I sort of answered my own question in that post, haha, and the workaround is to put each sprite in an atlas by itself.
However, I would like to know, is there any way to get the range of UVs that a sprite is using? Within the atlas? Right now I have this super simple progress-bar shader:
varying mediump vec2 var_texcoord0;
uniform lowp sampler2D DIFFUSE_TEXTURE;
uniform lowp vec4 fill;
uniform lowp vec4 fgtint;
uniform lowp vec4 bgtint;
void main()
{
vec4 outcolor = fgtint;
if ( var_texcoord0.x > fill.x ) outcolor = bgtint;
gl_FragColor = texture2D(DIFFUSE_TEXTURE, var_texcoord0) * outcolor;
}
Is there any way to make this work with a sprite in an atlas with other sprites? I guess to get the min and max values of var_texcoord0.x
for that sprite, so I can remap them to 0-1?
I realize that the answer to my question is probably: “No”, and I can live with that.