Changing color in each rendering loop in open gl es 2.0


I want to change the color of the drawn element(line) in each rendering loop.
Please let me know what to do in fragment shader and other parts of the code.
As I am a newbee, plz forgive me for such a silly question.


You can take uniform variable in fragment shader and assign that to gl_Fragcolor. Now in your draw function loop, change your local variable as per your color requirement and assign value of this local variable to uniform variable.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.