Jump to content
  • Advertisement
Sign in to follow this  
yhbae

Changing the light brightness

This topic is 2789 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!