[Fieldtrip] Re: Adding lighting to FieldTrip

Ivan Tomac tomac at pacific.net.au
Fri Dec 12 12:50:49 EST 2008


Hi David,

Adding lighting in this way makes sense for the fixed function OpenGL 
pipeline but it is too restrictive and redundant for shaders.
gl_LightSource was provided in GLSL for backwards compatibility, mostly 
for those who want to add shaders to their existing applications that 
use legacy OpenGL.

With shaders, rather than rely on several fixed functions for lighting 
it is now possible to implement all kinds of different forms of lighting 
and the 8 light limitation of the fixed function pipeline is no longer 
there either.

One final thing to note is that as of OpenGL 3.0, all lighting functions 
have been deprecated.

Regards,

Ivan

 >> I'm not sure if the maximum number of lights applies when using 
custom GPU
 >> shaders...
 >>
 >
 > I looked into this. An example shader application [1] used normal 
glLight*
 > commands to set up the lighting.  This tutorial [2] shows that 
shaders have
 > access the light information via. the gl_LightSource array and have the
 > option to use it or not. I can imagine someone defining unlimited light
 > parameters with uniform variables in glsl if they really wanted to.
 >
 > [1] http://cs.anu.edu.au/Student/comp4610/2007/labs/gpu.html
 > [2] http://www.clockworkcoders.com/oglsl/tutorial5.htm
 >
 > David


More information about the FieldTrip mailing list