Hi,
any way i can get sprite position on world without passing it using Uniform ,i wanna use one shader on multiple sprites and i want to get each sprite position in world ,I have moving camera and the shader is not moving with the camera .
the default shader of sprite is noMVP, so the value “a_position” in the vert file is the value of sprite’s world position, you can simply pass the value to .frag file,
for example:
in my case I write my own light class, and all the lights and sprites are under the default camera. I move the parent layer to simulate camera moving. In my shader of sprite I pass the light’s world position and use the a_position of sprite to calculate the light effect.