So I have been shading (brighten/darken +adding color) my sprites by using glTexEnvf with GL_MODULATE and GL_ADD and a vertex color. I only had to rebind the batch every time I needed to change from modulate to add and vice versa. it was not perfect but worked well enough.
However libGDX 1.0 dropped support for OpenGL1.1 and the only way I see is to use shaders. I want to stay up to date and therefore want to update. I am new to shaders but I found some code that works to brighten a sprite. However as far as I understood I need to rebind the batch every time I want another value for my brightness => batch binding on every sprite I render. That is not very performant.
- Is there a way to change values between the bindings? (I don't think it's possible because shaders get compiled afaik).
- Or do you have another idea how to archive this effect with openGL2.0 (like I did before)?
- Or is rebinding every sprite the most efficient way with OpenGL2.0?