Directional Lights

‘Directional Lights’ are very useful for creating effects such as sunlight in your scenes. Behaving in many ways like the sun, Directional Lights can be thought of as distant light sources which exist infinitely far away.

Light rays emitted from Directional Lights are parallel to one another and do not diverge like those from other light types. As a result, shadows cast by Directional Lights look the same, regardless of their position relative to the source. This is useful to us, especially when lighting outdoor scenes.

Directional Light

As Directional Lights do not have a source position, they can be placed anywhere in your scene without changing the effect of the light. Rotating the light however does greatly affect the visual result.

With other light types where there is an obvious source position, such as Spotlights, character shadows will change as the character moves closer to the light source. This can be a problem when trying to generate character shadows in interior levels. Directional lights are advantageous in these situations as shadows remain consistent regardless of proximity to the light source.

Directional Lights do not diminish over distance. As they affect all surfaces in your scene (unless culled), they pose a performance cost when using the Deferred Rendering path. Remember that when using this rendering technique, the performance cost of a light is relative to the number of pixels it illuminates. However, despite the cost, performance will at least be consistent and as such, easier to balance.

By default, every new Unity scene contains a Directional Light. In Unity 5, this is linked to the procedural sky system defined in the Environment Lighting section of the Lighting Panel (Lighting>Scene>Skybox). You can change this behaviour by deleting the default Directional Light and creating a new light or simply by specifying a different GameObject from the ‘Sun’ parameter (Lighting>Scene>Sun).

Rotating the default Directional Light (or ‘Sun’) causes the ‘Skybox’ to update. With the light angled to the side, parallel to the ground, sunset effects can be achieved. Additionally, pointing the light upwards causes the sky to turn black, as if it’s nighttime. With the light angled from above, the sky will resemble daylight.

If the Skybox is selected as the ambient source, Ambient Lighting will change in relation to these colors.

results matching ""

    No results matching ""