Directional light from a distance, as from the Sun.
    public class DirectionalLight : Light

A directional light is a type of Light node that models an infinite number of parallel rays covering the entire scene. It is used for lights with strong intensity that are located far away from the scene to model sunlight or moonlight. The worldspace location of the DirectionalLight transform (origin) is ignored. Only the basis is used do determine light direction.

Inheritance Chain

Constructors

    public DirectionalLight()

Properties

    public float DirectionalShadowBiasSplitScale { get; set; }

Amount of extra bias for shadow splits that are far away. If self shadowing occurs only on the splits far away, this value can fix them.

    public bool DirectionalShadowBlendSplits { get; set; }

If true, shadow detail is sacrificed in exchange for smoother transitions between splits. Default value:false.

    public ShadowDepthRange DirectionalShadowDepthRange { get; set; }

Optimizes shadow rendering for detail versus movement. See ShadowDepthRange.

    public float DirectionalShadowMaxDistance { get; set; }

The maximum distance for shadow splits.

    public ShadowMode DirectionalShadowMode { get; set; }

The light’s shadow rendering algorithm. See ShadowMode.

    public float DirectionalShadowNormalBias { get; set; }

Can be used to fix special cases of self shadowing when objects are perpendicular to the light.

    public float DirectionalShadowSplit1 { get; set; }

The distance from camera to shadow split 1. Relative to DirectionalShadowMaxDistance. Only used when DirectionalShadowMode is one of the SHADOW_PARALLEL_*_SPLITS constants.

    public float DirectionalShadowSplit2 { get; set; }

The distance from shadow split 1 to split 2. Relative to DirectionalShadowMaxDistance. Only used when DirectionalShadowMode is SHADOW_PARALLEL_3_SPLITS or SHADOW_PARALLEL_4_SPLITS.

    public float DirectionalShadowSplit3 { get; set; }

The distance from shadow split 2 to split 3. Relative to DirectionalShadowMaxDistance. Only used when DirectionalShadowMode is SHADOW_PARALLEL_4_SPLITS.

Methods

    public ShadowDepthRange GetShadowDepthRange()

Getter for DirectionalShadowDepthRange

    public ShadowMode GetShadowMode()

Getter for DirectionalShadowMode

    public bool IsBlendSplitsEnabled()

Getter for DirectionalShadowBlendSplits

    public void SetBlendSplits(bool enabled)

Setter for DirectionalShadowBlendSplits

    public void SetShadowDepthRange(ShadowDepthRange mode)

Setter for DirectionalShadowDepthRange

    public void SetShadowMode(ShadowMode mode)

Setter for DirectionalShadowMode

Inner Types

ShadowDepthRange

Name Value Description
Stable 0 Keeps the shadow stable when the camera moves, at the cost of lower effective shadow resolution. Default value.
Optimized 1 Tries to achieve maximum shadow resolution. May result in saw effect on shadow edges.

ShadowMode

Name Value Description
Orthogonal 0 Renders the entire scene’s shadow map from an orthogonal point of view. May result in blockier shadows on close objects.
Parallel2Splits 1 Splits the view frustum in 2 areas, each with its own shadow map.
Parallel4Splits 2 Splits the view frustum in 4 areas, each with its own shadow map.
Tags: