Lighting

This is a discussion on Lighting within the Game Programming forums, part of the General Programming Boards category; I know there are 2 types of lights: directional and positional. Could someone give me a more in depth answer ...

Lighting

I know there are 2 types of lights: directional and positional. Could someone give me a more in depth answer as to their differences and when I should use which ones. I know directional is infinitely far away and positional is equivalent to a lamp. How do I decide which to use and when is it useful.
Thanks

Positional lights are omni-directional, and are often called point lights I believe. They cast light in all directions from a single point. A directional light casts light in one direction specified by a vector.

The sun is a good example of a positional light. A directional light could be a cars headlight, or anything that only illuminates one direction. You'll probably find yourself using positional lights most of the time, since they're pretty good and simulating most types of lights you'll need in your games. I've never actually had any use for directional lights, personally.

Directional lights are good for base diffuse lighting - light that cannot be generated any other way. Directional lights simulate the sun shining down at a certain angle everywhere at all times. When mixed with ambient light and point light sources the entire scheme looks rather nice when done right.

Point light = light bulb, sun in space game, etc.
Directional = sun shining down on earth at midday, evening, etc. - light is all around.
Spot = similar to a spotlight at a concert or on a lighthouse.
Ambient = the light that is always present - the basic lighting for your environment

If you ever play FPS games or sims, the ambient light is the light that illuminates everything at night when all other light sources have been turned off or removed. It will never get any darker than the ambient lighting value.