PDA

View Full Version : Directional Lights



halo
04-10-2005, 05:20 PM
Is there any way to create a directional light in OpenGL? This is not a point light or a spot light. A directional light has no position, and just calculates light intensity by the light direction and vertex normal. No matter where the polygon is positioned in space, a directional light will light it the same way.

Patrick Drummond
04-10-2005, 07:34 PM
How about a luminosity map? Example (http://http://www.apgsoftware.co.uk/gl/lightmap.html)

mogumbo
04-10-2005, 08:00 PM
Set the w component of the light position to 0 to make it a directional light. This is covered in the red book if you happen to have a copy.

halo
04-11-2005, 07:13 AM
Excellent. The x, y, and z components then become the directional vector.

Thanks, it works perfectly.