View Full Version : OGL Pointlight

04-02-2004, 11:14 PM
Hello! :)

How can I setup a point light in OpenGL and set it to a small range? I played a bit around with the parameters of the glLight() Functions, but I could not find out how to set the light to a certain range, and make it a pointlight, not a spotlight.

Thank you for information

04-03-2004, 12:15 AM
Set GL_POSITION to some x,y,z,1 value.
Set GL_LINEAR_ATTENUATION and/or GL_QUADRATIC_ATTENUATION to a value suitable for you.

The other parameters can be let to their defaults, but you can explicitly set GL_SPOT_CUTOFF to 180 if keep getting a spotlight.