Game Development Reference
In-Depth Information
Lighting your world and providing it with
dynamic lights
This recipe will mostly be theories on different lighting types, but we'll also explore a way
to easily control the movement of lights.
The four main types of lights that we can use to light up our world are as follows:
Ambient Light : This lights up everything in the scene evenly. It's good for avoid-
ing anything to be in a pitch-black state, but it doesn't create any shadows or nu-
ances. Adding a too bright ambient light will give the world a bland look, while
giving it a touch of color can set the mood.
Directional Light : This shines from a particular direction with perfectly parallel
rays and without any falloff. This is usually used to simulate a sun, a bright source
of light located far away.
Point Light : This shines equally in every direction but with a falloff, meaning this
will eventually stop illuminating the surroundings. Usually, this forms most of the
light sources in a game scene.
Spot Light : This is exactly as it sounds. This produces a cone-shaped light in a
specific direction from a specific location, and its light will eventually fall off. It
has more settings than its sibling light types. Technically, it is more advanced than
point lights and requires additional calculations in the shader to see what it illumin-
ates.
A spotlight with the same spotInnerAngle and spotOuterAngle parameters will
have a light cone that looks like this:
Search WWH ::




Custom Search