PDA

View Full Version : Lighting



EraZer
03-03-2004, 09:51 AM
Why there is a limited number of availble light sources that can be used into scene, and is there any way to avoid this limitation?

dorbie
03-03-2004, 12:32 PM
There are practical limits to what cost effective hardware can provide in a fixed function pipeline. In addition times have changed and the minimum requirements for lights were set at 8 a decade ago. So the limit is not absolute it is a minimum requirement for OpenGL conformance.

glgetintegerv with a GL_MAX_LIGHTS token will tell you how many lights are supported, with a minimum of 8 guaranteed by OpenGL.

This presentation and example code by Mark Kilgard shows how to squeeze more lights into a scene than the available OpenGL lights:
http://www.opengl.org/resources/code/rendering/mjktips/VirtualizedLights/Virtua lizedLights.html (http://www.opengl.org/resources/code/rendering/mjktips/VirtualizedLights/VirtualizedLights.html)



[This message has been edited by dorbie (edited 03-03-2004).]