In
computer graphics, different types of lights can be rendered, with each
type altering the lighting algorithm to create a specific type of
effect. In this section we will briefly discuss the following light
types.
Directional Lights
A
directional light in computer graphics appears to come from a direction
but has no specific point of origin. Directional lights are the types
of lights used to simulate light coming from far away.
Point Lights
A
point light emits from a point in space, where the light decreases in
intensity over distance. This type of light can be a light bulb,
candle, light from a TV screen, and so forth. In computer graphics, a
point light usually emits light equally across a radius in all
directions, while a directional light emits light in a specific
direction with no fall-off in intensity with distance.
Light
decreasing over distance is known as light attenuation, and it is the
property of a point light that creates the point light affect. In other
words, if you take a directional light and apply attenuation, you can
create the point light effect.
Spot Lights
A
spot light is essentially a point light that is restricted to a
direction, often in the shape of a cone, instead of shining in all
directions. In real life we use objects to block light’s ability to
shine in certain directions. In computer graphics various mathematical
equations can be used to simulate the spot light effect.
Area Lights
An
area light in computer graphics is an array of lights that collectively
cover an area. Areas lights are commonly used to produce soft shadows
in a scene by allowing the various surfaces of a scene to be sampled
not only by more than one light but also by slightly varying the
positions of these lights. This causes the surfaces to be rendered in a
way that softens sharp shadows since the lighting contribution for the
discreet points throughout an area light source affect those dark
areas. In other words, the shadows themselves receive light that
gradually lightens them up, giving a soft shadow appearance.
Therefore,
if you use a large array of many point lights, the shadows in the scene
will receive light from some of the area light points more than others,
creating the softening effect. This occurs because single light sources
shade pixels so that those pixels are either in light or in shadow,
which creates hard shadows. By creating an area of lights and by
accumulating the results, the “in shadow” or “in light” question
becomes what percentage is in light versus in shadow, which creates the
varying shades of gray necessary for soft shadows.
In
real life, light bounces around the environment so many times that
shadows are soft because the shadows are not actually the result of no
light at all, but instead are the result of some surfaces not being lit
as much as others. Light bouncing around the scene falls under the
topic of global illumination, which is a highly advanced computer
graphics topic. Area lights do not bounce off of surfaces and therefore
are not considered global illumination. Area lights, basically, are
just a lot of lights covering an area.
Area
lights are used more in ray-traced scenes than in video game scenes
since the number of light sources in an area light necessary to create
believable soft shadows can be far more expensive than what is
reasonable for a game’s real-time requirements. Lighting can become
expensive, and area lights can be very costly.