PDA

View Full Version : Changing color in each rendering loop in open gl es 2.0



biplab777
05-27-2012, 10:11 PM
Hi,

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.

Thanks,
Biplab

debinair
05-31-2012, 12:57 AM
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.