Range limited lighting

DX is able to specify a range for each light. verts beyond this range are not lit by the light, regardless of the attenuation settings used. This is pretty useful in some cases.

Is it possible to do something similar to this using opengl (and without resorting to vertex shaders)?


You can do it using register combiners on GeForce video cards. Check out this site for a good explanation of how to do it:

Jason A.
DelphiGL (http://delphigl.cfxweb.net)

You may also want to look into the glLight function. It allows you to specify constant, linear, or quadratic attenuation.

Jason A.
DelphiGL (http://delphigl.cfxweb.net)

I am already using the attenuation (as I mentioned). I was hoping there might be a simple extension that supported this range limited behaviour that I was not aware of.

For example, it would be nice to be able to do something like this…

sglLightf(GL_LIGHT0, GL_EXT_RANGE, 10.0f);

to stop a light effecting any verts that are > 10 units away. All verts less than 10 units away are effected by the normal attenuation rules.