Ew… its not the cleanest work around but I am going to use a #define placeholder and then do a regex replace and add in a switch that will handle the layer loop.
I got it actually the switch solution adds 1 more calc per frame, but really does nothing to the performance.
I was looking initially at doing it how you just suggested, but it looks like the switch solution ends up fitting into the code structure a little better.
I’ll be submitting a PR to fix the SpriteMap here soon.
to top of fragment shader and kept getting the same error.
So the extension was there but it wasn’t using it.
Eventually I realised that I had this set at the top of the my fragment shader:
#version 300 es
When I changed this to
#version 310 es
it started working fine with the indices passed into the shader from uniforms.