Open GL ES 1.0 Lighting

Started by vickt, July 08, 2012, 05:11:39 AM

Previous topic - Next topic

vickt

The effects of lights in either OpenGL ES 1.0 or 2.0 are not changed by distance (the intensity of the lighting on objects does not fade out). This can beeasily accomplished by modifying the default shaders, but that would require OpenGL ES 2.0, which would bring a performance drop. Is there anyway to create this functionality in OpenGL ES 1.0?

EgonOlsen

It's disabled and not visible in the API, because at the time i tried to port it to Android, it simply didn't work correctly on my device or the emulator. So far, nobody has complained about it. I'll have a look and see if the situation has changed...

EgonOlsen

Seems to work fine on current devices, so i made the method (Light.setAttenuation(<float>)) public again and added support for it to the 2.0 renderer too (new uniform called attenuation in the default shaders). The lower the value, the faster the fading. -1 means no fading.

Please check it out: http://jpct.de/download/beta/jpct_ae.jar

Terrabus

Looks beautiful on Samsung Galaxy SII. Thank you very much.