Changing the light brightness

Started by
0 comments, last by Vilem Otte 13 years, 4 months ago
So far, I've been able to set the light properties and brightness settings in onSurfaceCreated() function and works like a charm.

I've hardcoded a "walking path" so that the scene appears as if a person is walking through the scene I've created.

Now, I am trying to change the brightness of one of the lights during the scene. How would I go about doing this?

So far, I tried to set glLightfv(with GL_AMBIENT flag and different brightness settings) within onDrawFrame() function and that didn't do anything. I also tried disabling and re-enabling it before and after glLightfv() which also didn't help.

This should be possible, correct?

Thank you.
Advertisement
It is possible, though I can't remember how to do it with fixed function... I think you must set not just glLightfv GL_AMBIENT, but also glMaterialfv GL_AMBIENT (because total ambient should be light_ambient * material_ambient). Then it is just playing with values.

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com

This topic is closed to new replies.

Advertisement