Point Lights

Hi all,

I need to render my scene with a PointLight with Attenuation (LINEAR_ATTENUATION for exemple).

Can someone guide me to get the source code running to acomplish it??


Check out the documentation for the glLight() function call:

void glLightf(
GLenum light,
GLenum pname,
GLfloat param

The params parameter is a single integer or floating-point value that specifies one of the three light attenuation factors. Integer and floating-point values are mapped directly. Only nonnegative values are accepted. If the light is positional, rather than directional, its intensity is attenuated by the reciprocal of the sum of: the constant factor, the linear factor multiplied by the distance between the light and the vertex being lighted, and the quadratic factor multiplied by the square of the same distance. The default attenuation factors are (1,0,0), resulting in no attenuation.