Struct DirectionalLight

Directional light from a distance, as from the Sun.

struct DirectionalLight ;

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.

Properties

NameTypeDescription
directionalShadowBiasSplitScale[get, set] doubleAmount 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.
directionalShadowBlendSplits[get, set] boolIf true, shadow detail is sacrificed in exchange for smoother transitions between splits.
directionalShadowDepthRange[get, set] DirectionalLight.ShadowDepthRangeOptimizes shadow rendering for detail versus movement. See shadowdepthrange.
directionalShadowMaxDistance[get, set] doubleThe maximum distance for shadow splits.
directionalShadowMode[get, set] DirectionalLight.ShadowModeThe light's shadow rendering algorithm. See shadowmode.
directionalShadowNormalBias[get, set] doubleCan be used to fix special cases of self shadowing when objects are perpendicular to the light.
directionalShadowSplit1[get, set] doubleThe distance from camera to shadow split 1. Relative to directionalShadowMaxDistance. Only used when directionalShadowMode is SHADOW_PARALLEL_2_SPLITS or SHADOW_PARALLEL_4_SPLITS.
directionalShadowSplit2[get, set] doubleThe 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.
directionalShadowSplit3[get, set] doubleThe distance from shadow split 2 to split 3. Relative to directionalShadowMaxDistance. Only used when directionalShadowMode is SHADOW_PARALLEL_4_SPLITS.

Methods

NameDescription
getShadowDepthRange
getShadowMode
isBlendSplitsEnabled
setBlendSplits
setShadowDepthRange
setShadowMode

Enums

NameDescription
Constants
ShadowDepthRange
ShadowMode