Author Topic: Open GL ES 1.0 Lighting  (Read 769 times)

Offline vickt

  • byte
  • *
  • Posts: 9
    • View Profile
Open GL ES 1.0 Lighting
« on: July 08, 2012, 05:11:39 am »
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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11775
    • View Profile
    • http://www.jpct.net
Re: Open GL ES 1.0 Lighting
« Reply #1 on: July 08, 2012, 09:28:24 am »
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...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11775
    • View Profile
    • http://www.jpct.net
Re: Open GL ES 1.0 Lighting
« Reply #2 on: July 08, 2012, 09:01:57 pm »
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

Offline Terrabus

  • byte
  • *
  • Posts: 7
    • View Profile
Re: Open GL ES 1.0 Lighting
« Reply #3 on: July 09, 2012, 02:44:38 pm »
Looks beautiful on Samsung Galaxy SII. Thank you very much.