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 to 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, increasing this value can fix them.

    public bool DirectionalShadowBlendSplits { get; set; }

If true, shadow detail is sacrificed in exchange for smoother transitions between splits.

    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 SHADOW_PARALLEL_2_SPLITS or SHADOW_PARALLEL_4_SPLITS.

    public float DirectionalShadowSplit2 { get; set; }

The distance from shadow split 1 to split 2. Relative to DirectionalShadowMaxDistance. Only used when DirectionalShadowMode is SHADOW_PARALLEL_2_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

    [Obsolete("GetShadowDepthRange is deprecated. Use the DirectionalShadowDepthRange property instead.")]
    public ShadowDepthRange GetShadowDepthRange()

Getter for DirectionalShadowDepthRange

    [Obsolete("GetShadowMode is deprecated. Use the DirectionalShadowMode property instead.")]
    public ShadowMode GetShadowMode()

Getter for DirectionalShadowMode

    [Obsolete("IsBlendSplitsEnabled is deprecated. Use the DirectionalShadowBlendSplits property instead.")]
    public bool IsBlendSplitsEnabled()

Getter for DirectionalShadowBlendSplits

    [Obsolete("SetBlendSplits is deprecated. Use the DirectionalShadowBlendSplits property instead.")]
    public void SetBlendSplits(bool enabled)

Setter for DirectionalShadowBlendSplits

    [Obsolete("SetShadowDepthRange is deprecated. Use the DirectionalShadowDepthRange property instead.")]
    public void SetShadowDepthRange(ShadowDepthRange mode)

Setter for DirectionalShadowDepthRange

    [Obsolete("SetShadowMode is deprecated. Use the DirectionalShadowMode property instead.")]
    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.
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: