Directional lights
BeginnerDesignerArtist Directional lights come uniformly from one direction. They’re often used for simulating large, distant light sources such as the sun, and cast shadows. By default, new scenes you create in Xenko contain a directional light. The Scene Editor shows the position of directional lights with the following icon: When you select a directional light, the gizmo displays the light’s main direction:
Properties
Shadows cast by directional lights
point lights and spot lights, directional lights cast shadows. However, shadows cast by directional lights can spawn across a large view range, so they require special treatment to improve their realism. cascaded shadow mapping. This consists of rendering the depth of occluding objects from the point of view of the light to a texture, then rendering the scene taking the occluder information into account. This method slices the depth range from the camera’s point of view into different sections or “cascades” of different resolutions. The nearer each cascade is to the camera, the higher resolution it has, and the higher-resolution its shadows are. Put simply, the closer shadows are to the camera, the better quality they are. This means you can spend more memory on shadows closer to the camera, where you can see them, and less on distant shadows. You can have one, two, or four cascades. The more cascades you use, the more memory you save, but the lower resolution your shadows become over distance. This an example of a shadow map generated from a directional light, using four cascades:
See shadow cascades in the editor
Property Grid, under the Shadow properties, enable the Debug option. The different colors indicate the cascade for each distance range (Green: 0, Blue: 1, Purple: 2, Red: 3).
Directional light shadow properties
See also
- Add a light
- Point lights
- Ambient lights
- Skybox lights
- Spot lights
- Light probes
- Light shafts
- Shadows
