Different Light in Unity- Game Dev Series 151
Objective: using 3 different light in Unity.
Lighting is quite something in 3D environment.
Unity provides 4 different light that we can easily use in our scene.
- Directional Light
- Point Light
- Area Light
However, Area Light would be a little different in using.
In this article, I will introduce 3 of the 4 light would commonly be used in 3D scene.
Directional Light is the default light when you create an Unity project and into a game scene for the first time. It provides an infinity, directional lighting to all the objects in this game scene.
It would cast to everything in the scene, which you can easily to check the result in realtime when adjusting.
However, due to its infinity(from outsides of game scene), it can contains some issue when using in game scene.
As you can see, all the interior objects are no light reflection on them because it all got blocked from ceiling.
To solve this problem, we can set the Culling Mask to make the light go through ceiling.
First, we need to create a new Layer in Unity, and assign ceiling with all of its children to this layer.
Then we can set the Culling Mask of our Directional Light to this layer. Make it ignore all the objects under this layer.
Let’s check the result after culling the ceiling.
This one can be used as actual lighting object in game or highlight some items/ objects you would like to players pay attention on.
You can also adjust the color of point light to make it fit in the whole environment.
Let’s check the difference after adding Poing Light.
Spotlight is usually used to make some unique light focusing on some objects. When you want to cast some shadow to create visible depth of whole space, or using on players as a torchlight.
I usually use Spotlight to create some unique shape of lighting in scene.
Let’s check the result after adding Spotlight.