Ambient lighting question

I’m trying to use Light0 to light a simple scene. The scene is being lit, but polys which are facing away from the light are very dark. I tried setting the GL_AMBIENT value for light0 to something brighter than the default to correct this, however, it doesn’t seem to have any effect. The polys facing away from the light are still very dark. Is there a trick to this?

You need to set the material ambient color to the desired value (probably just make it match your diffuse color). It’s a bit redundant but it gives you more independent control of limited non physical lighting.

Note that this is all legacy functionality and you should try to progress to shaders when you are able.

I’d love to use shaders. However, I’m writing for the lowest common denominator. My app is eventually going to be ported over to Android platforms and I’m not sure if Android supports shaders in openGL ES.

Any Android platform you care about has first class support for OpenGL ES 2.0 which is shaders only, no fixed function.

There is OpenGL ES 1.1 support usually through backwards compatability where the driver uses shaders for the fixed function pipeline you set up.

You should go with shaders for Android, and install Google’s Angle API to develop for OpenGL ES on the desktop accross cards if Android is your target.

OpenGL desktop shaders are slightly different with more functionality and different keywords than OpenGL ES. Some of these changes are cosmetic. If you get Angle and code on it you know you will be writing portable code. It is shader based though :slight_smile: