UDirectionalLightComponent

A light component that has parallel rays.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Components/DirectionalLightComponent.h

Include

#include "Components/DirectionalLightComponent.h"

Syntax

class UDirectionalLightComponent : public ULightComponent

Remarks

A light component that has parallel rays. Will provide a uniform lighting across any affected surface (eg. The Sun). This will affect all objects in the defined light-mass importance volume.

Variables

Name Description

Public variable

uint32: 1

 

bCastModulatedShadows

Whether the light should cast modulated shadows from dynamic objects (mobile only).

Public variable

uint32: 1

 

bEnableLightShaftOcclusion

Whether to occlude fog and atmosphere inscattering with screenspace blurred occlusion from this light.

Public variable

uint32: 1

 

bUsedAsAtmosphereSunLight

Public variable

uint32: 1

 

bUseInsetShadowsForMovableObjects

Stationary lights only: Whether to use per-object inset shadows for movable components, even though cascaded shadow maps are enabled.

Public variable

float

 

CascadeDistributionExponent

Controls whether the cascades are distributed closer to the camera (larger exponent) or further from the camera (smaller exponent).

Public variable

float

 

CascadeTransitionFraction

Proportion of the fade region between cascades.

Public variable

float

 

DistanceFieldShadowDistance

Distance at which the ray traced shadow cascade should end.

Public variable

int32

 

DynamicShadowCascades

Number of cascades to split the view frustum into for the whole scene dynamic shadow.

Public variable

float

 

DynamicShadowDistanceMovableLight

How far Cascaded Shadow Map dynamic shadows will cover for a movable light, measured from the camera.

Public variable

float

 

DynamicShadowDistanceStationaryLight

How far Cascaded Shadow Map dynamic shadows will cover for a stationary light, measured from the camera.

Public variable

int32

 

FarShadowCascadeCount

0: no DistantShadowCascades, otherwise the count of cascades between WholeSceneDynamicShadowRadius and DistantShadowDistance that are covered by distant shadow cascades.

Public variable

float

 

FarShadowDistance

Distance at which the far shadow cascade should end.

Public variable

FLightmassDirec...

 

LightmassSettings

The Lightmass settings for this object.

Public variable

FVector

 

LightShaftOverrideDirection

Can be used to make light shafts come from somewhere other than the light's actual direction.

Public variable

float

 

LightSourceAngle

Angle subtended by light source in degrees (also known as angular diameter).

Public variable

float

 

LightSourceSoftAngle

Angle subtended by soft light source in degrees.

Public variable

FColor

 

ModulatedShadowColor

Color to modulate against the scene color when rendering modulated shadows. (mobile only)

Public variable

float

 

OcclusionDepthRange

Everything closer to the camera than this distance will occlude light shafts.

Public variable

float

 

OcclusionMaskDarkness

Controls how dark the occlusion masking is, a value of 1 results in no darkening term.

Public variable

float

 

ShadowCascadeBiasDistribution

Controls the depth bias scaling across cascades.

Public variable

float

 

ShadowDistanceFadeoutFraction

Controls the size of the fade out region at the far extent of the dynamic shadow's influence.

Public variable

float

 

TraceDistance

Determines how far shadows can be cast, in world units. Larger values increase the shadowing cost.

Constructors

Name Description

Public function

UDirectionalLightComponent

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

SetCascadeDistributionExponent

(
    float NewValue
)

Public function

void

 

SetCascadeTransitionFraction

(
    float NewValue
)

Public function

void

 

SetDynamicShadowCascades

(
    int32 NewValue
)

Public function

void

 

SetDynamicShadowDistanceMovableLight

(
    float NewValue
)

Public function

void

 

SetDynamicShadowDistanceStationaryLight

(
    float NewValue
)

Public function

void

 

SetEnableLightShaftOcclusion

(
    bool bNewValue
)

Public function

void

 

SetLightShaftOverrideDirection

(
    FVector NewValue
)

Public function

void

 

SetOcclusionMaskDarkness

(
    float NewValue
)

Public function

void

 

SetShadowDistanceFadeoutFraction

(
    float NewValue
)

Overridden from ULightComponent

Name Description

Public function Virtual Const

FLightSceneP...

 

CreateSceneProxy()

Public function Virtual Const

FLightmassLi...

 

GetLightmassSettings()

Public function Virtual Const

FVector4

 

GetLightPosition()

Return the homogenous position of the light.

Public function Virtual Const

ELightCompon...

 

GetLightType()

Public function Virtual Const

float

 

GetUniformPenumbraSize()

Public function Virtual Const

bool

 

IsUsedAsAtmosphereSunLight()

Whether to consider light as a sunlight for atmospheric scattering.

Overridden from UActorComponent

Name Description

Public function Virtual

void

 

InvalidateLightingCacheDetailed

(
    bool bInvalidateBuildEnqueuedLighti...,
    bool bTranslationOnly
)

Called when this actor component has moved, allowing it to discard statically cached lighting information.

Overridden from UObject

Name Description

Public function Virtual Const

bool

 

CanEditChange

(
    const UProperty* InProperty
)

Called by the editor to query whether a property of this object is allowed to be modified.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called after property has changed via e.g. property window or set command.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Deprecated Variables

Name Description

Public variable

float

 

WholeSceneDynamicShadowRadius_DEPRECATED

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback