Introduction to Unity's lights and shadows
Lighting in games is important as it is what allows GameObjects to be seen. If we did not have lights in our game, the game screen would be completely black. In Unity, it is easy to take lighting for granted because, when we create a new scene, there is a default Main Camera
and a Directional Light
.Â
Shadows in game worlds are another component that can be taken for granted because Unity's default settings regarding shadows is often sufficient for games.Â
In this section, we will look at light sources and shadows.
Adding light sources
In Unity, lights are GameObjects and are available in several different types. Here are the most common types of light sources:
- Directional light
- Point light
- Spot light
- Area light
Let's look at each of these lights.
Directional light
The Directional light is like the sun. As you can see from the following Inspector
panel, there are several settings that can be adjusted for Directional lights beyond the Transform's Position
, Rotation...