Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/Components
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- USceneComponent
- ULightComponentBase
- ULightComponent
- UDirectionalLightComponent
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
| Type | Name | Description | |
|---|---|---|---|
| FLinearColor | AtmosphereSunDiskColorScale | A color multiplied with the sun disk luminance. | |
| int32 | AtmosphereSunLightIndex | Two atmosphere lights are supported. For instance: a sun and a moon, or two suns. | |
| uint32: 1 | bAtmosphereSunLight | Whether the directional light can interact with the atmosphere, cloud and generate a visual disk. | |
| uint32: 1 | bCastCloudShadows | Whether the light should cast any shadows from clouds onto the atmosphere and other scene elements. | |
| uint32: 1 | bCastModulatedShadows | Whether the light should cast modulated shadows from dynamic objects (mobile only). | |
| uint32: 1 | bCastShadowsOnAtmosphere | Whether the light should cast any shadows from opaque meshes onto the atmosphere. | |
| uint32: 1 | bCastShadowsOnClouds | Whether the light should cast any shadows from opaque meshes onto clouds. | |
| uint32: 1 | bEnableLightShaftOcclusion | Whether to occlude fog and atmosphere inscattering with screenspace blurred occlusion from this light. | |
| uint32: 1 | bPerPixelAtmosphereTransmittance | Whether to apply atmosphere transmittance per pixel on opaque meshes, instead of using the light global transmittance. | |
| uint32: 1 | bUseInsetShadowsForMovableObjects | Stationary lights only: Whether to use per-object inset shadows for movable components, even though cascaded shadow maps are enabled. | |
| float | CascadeDistributionExponent | Controls whether the cascades are distributed closer to the camera (larger exponent) or further from the camera (smaller exponent). | |
| float | CascadeTransitionFraction | Proportion of the fade region between cascades. | |
| FLinearColor | CloudScatteredLuminanceScale | Scales the lights contribution when scattered in cloud participating media. | |
| float | CloudShadowDepthBias | The bias applied to the shadow front depth of the volumetric cloud shadow map. | |
| float | CloudShadowExtent | The world space radius of the cloud shadow map around the camera in kilometers. | |
| float | CloudShadowMapResolutionScale | Scale the cloud shadow map resolution, base resolution is 512. | |
| float | CloudShadowOnAtmosphereStrength | The strength of the shadow on atmosphere. Disabled when 0. | |
| float | CloudShadowOnSurfaceStrength | The strength of the shadow on opaque and transparent meshes. Disabled when 0. | |
| float | CloudShadowRaySampleCountScale | Scale the shadow map tracing sample count. | |
| float | CloudShadowStrength | The overall strength of the cloud shadow, higher value will block more light. | |
| float | DistanceFieldShadowDistance | Distance at which the ray traced shadow cascade should end. | |
| int32 | DynamicShadowCascades | Number of cascades to split the view frustum into for the whole scene dynamic shadow. | |
| float | DynamicShadowDistanceMovableLight | How far Cascaded Shadow Map dynamic shadows will cover for a movable light, measured from the camera. | |
| float | DynamicShadowDistanceStationaryLight | How far Cascaded Shadow Map dynamic shadows will cover for a stationary light, measured from the camera. | |
| int32 | FarShadowCascadeCount | 0: no Far Shadow Cascades, otherwise the number of cascades between DynamicShadowDistance and FarShadowDistance that are covered by Far Shadow Cascades. | |
| float | FarShadowDistance | Distance at which the far shadow cascade should end. | |
| int32 | ForwardShadingPriority | Forward lighting priority for the single directional light that will be used for forward shading, translucent, single layer water and volumetric fog. | |
| FLightmassDirectionalLightSettings | LightmassSettings | The Lightmass settings for this object. | |
| FVector | LightShaftOverrideDirection | Can be used to make light shafts come from somewhere other than the light's actual direction. | |
| float | LightSourceAngle | Angle subtended by light source in degrees (also known as angular diameter). | |
| float | LightSourceSoftAngle | Angle subtended by soft light source in degrees. | |
| FColor | ModulatedShadowColor | Color to modulate against the scene color when rendering modulated shadows. (mobile only) | |
| float | OcclusionDepthRange | Everything closer to the camera than this distance will occlude light shafts. | |
| float | OcclusionMaskDarkness | Controls how dark the occlusion masking is, a value of 1 results in no darkening term. | |
| float | ShadowAmount | Control the amount of shadow occlusion. A value of 0 means no occlusion, thus no shadow. | |
| float | ShadowCascadeBiasDistribution | Controls the depth bias scaling across cascades. | |
| float | ShadowDistanceFadeoutFraction | Controls the size of the fade out region at the far extent of the dynamic shadow's influence. | |
| float | ShadowSourceAngleFactor | Shadow source angle factor, relative to the light source angle. | |
| float | TraceDistance | Determines how far shadows can be cast, in world units. Larger values increase the shadowing cost. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UDirectionalLightComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | SetAtmosphereSunLight
(
bool bNewValue |
||
| void | SetAtmosphereSunLightIndex
(
int32 NewValue |
||
| void | SetCascadeDistributionExponent
(
float NewValue |
||
| void | SetCascadeTransitionFraction
(
float NewValue |
||
| void | SetDynamicShadowCascades
(
int32 NewValue |
||
| void | SetDynamicShadowDistanceMovableLight
(
float NewValue |
||
| void | SetDynamicShadowDistanceStationaryLight
(
float NewValue |
||
| void | SetEnableLightShaftOcclusion
(
bool bNewValue |
||
| void | SetForwardShadingPriority
(
int32 NewValue |
||
| void | SetLightShaftOverrideDirection
(
FVector NewValue |
||
| void | SetLightSourceAngle
(
float NewValue |
||
| void | SetLightSourceSoftAngle
(
float NewValue |
||
| void | SetOcclusionDepthRange
(
float NewValue |
||
| void | SetOcclusionMaskDarkness
(
float NewValue |
||
| void | SetShadowAmount
(
float NewValue |
||
| void | SetShadowCascadeBiasDistribution
(
float NewValue |
||
| void | SetShadowDistanceFadeoutFraction
(
float NewValue |
||
| void | SetShadowSourceAngleFactor
(
float NewValue |
Overridden from ULightComponent
| Type | Name | Description | |
|---|---|---|---|
| FLightSceneProxy * | |||
| FLinearColor | |||
| uint8 | |||
| FLightmassLightSettings | |||
| FVector4 | Return the homogenous position of the light. | ||
| ELightComponentType | GetLightType () |
||
| ELightUnits | |||
| float | |||
| bool | Whether to consider light as a sunlight for atmospheric scattering. |
Overridden from UActorComponent
| Type | Name | Description | |
|---|---|---|---|
| bool | |||
| void | InvalidateLightingCacheDetailed
(
bool bInvalidateBuildEnqueuedLighting, |
Called when this actor component has moved, allowing it to discard statically cached lighting information. |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| bool | CanEditChange
(
const FProperty* InProperty |
Called by the editor to query whether a property of this object is allowed to be modified. | |
| void | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Called after property has changed via e.g. property window or set command. | |
| void | Handles reading, writing, and reference collecting using FArchive. |
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| uint32: 1 | bUsedAsAtmosphereSunLight_DEPRECATED | ||
| float | WholeSceneDynamicShadowRadius_DEPRECATED |