Game Development Reference
In-Depth Information
Different types of lights used in games
In gaming, we add light sources. These light sources can have different lighting
effects on our scene and objects. The distinct features of an object only appear if
we have added a light to our scene. A scene should have at least one light. The
appearance of an object will depend on the direction and position of the light. The
following light sources are classified by their distance and direction.
Directional lights
A directional light is produced by a light source placed at an infinite distance from
the object/scene. All of the light rays emanating from the light strike the polygons in
the scene from a single parallel direction and with equal intensity.
Sunlight is an example of a directional light. It is defined by properties such as color,
intensity, and direction.
Point lights
A point light is produced by a light source that gives off equal amounts of light in all
directions. Primitives that are closer to the light appear brighter than those that are
further away. The intensity varies with distance.
In a game, we will need point lights, similar to the street lamps shown as positional
lights in Chapter 3 , Loading the Game Scene . Point lights are defined by properties such
as color, intensity, location, and falloff function.
Spotlights
A spotlight is produced by a light source that radiates light in a cone with maximum
intensity at the center, gradually tapering off towards the sides of the cone. The
simplest spotlight would just be a point light that is restricted to a certain angle
around its primary axis of direction.
A car headlight would be an example of a spotlight. It is defined by properties such
as color, intensity, location, an axis of direction, a radius about that axis, and possibly
a radial falloff function.
 
Search WWH ::




Custom Search