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