UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DirectionalLightComponent.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
9
10#include "DirectionalLightComponent.generated.h"
11
13
17UCLASS(Blueprintable, ClassGroup=Lights, hidecategories=(Object, LightProfiles), editinlinenew, meta=(BlueprintSpawnableComponent), MinimalAPI)
19{
21
22
27 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = Light, AdvancedDisplay, meta = (UIMin = "0", UIMax = "1"))
28 float ShadowCascadeBiasDistribution;
29
31 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category=LightShafts, meta=(DisplayName = "Light Shaft Occlusion"))
32 uint32 bEnableLightShaftOcclusion:1;
33
37 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category=LightShafts, meta=(UIMin = "0", UIMax = "1"))
38 float OcclusionMaskDarkness;
39
41 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category=LightShafts, meta=(UIMin = "0", UIMax = "500000"))
42 float OcclusionDepthRange;
43
48 UPROPERTY(EditAnywhere, interp, AdvancedDisplay, BlueprintReadOnly, Category=LightShafts)
49 FVector LightShaftOverrideDirection;
50
51 UPROPERTY()
53
58 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category=CascadedShadowMaps, meta=(UIMin = "0", UIMax = "20000", DisplayName = "Dynamic Shadow Distance MovableLight"))
60
65 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category=CascadedShadowMaps, meta=(UIMin = "0", UIMax = "20000", DisplayName = "Dynamic Shadow Distance StationaryLight"))
67
72 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category=CascadedShadowMaps, meta=(UIMin = "0", UIMax = "4", DisplayName = "Num Dynamic Shadow Cascades"))
73 int32 DynamicShadowCascades;
74
79 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category=CascadedShadowMaps, meta=(UIMin = "1", UIMax = "4", DisplayName = "Distribution Exponent"))
80 float CascadeDistributionExponent;
81
91 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category=CascadedShadowMaps, meta=(UIMin = "0", UIMax = "0.3", DisplayName = "Transition Fraction"))
92 float CascadeTransitionFraction;
93
98 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category=CascadedShadowMaps, meta=(UIMin = "0", UIMax = "1.0", DisplayName = "Distance Fadeout Fraction"))
99 float ShadowDistanceFadeoutFraction;
100
107 UPROPERTY(EditAnywhere, AdvancedDisplay, BlueprintReadOnly, Category=CascadedShadowMaps, DisplayName = "Inset Shadows For Movable Objects")
108 uint32 bUseInsetShadowsForMovableObjects : 1;
109
111 UPROPERTY(EditAnywhere, AdvancedDisplay, BlueprintReadOnly, Category=CascadedShadowMaps, meta=(UIMin = "0", UIMax = "4"), DisplayName = "Far Shadow Cascade Count")
112 int32 FarShadowCascadeCount;
113
117 UPROPERTY(EditAnywhere, AdvancedDisplay, BlueprintReadOnly, Category=CascadedShadowMaps, meta=(UIMin = "0", UIMax = "800000"), DisplayName = "Far Shadow Distance")
118 float FarShadowDistance;
119
123 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=DistanceFieldShadows, meta=(UIMin = "0", UIMax = "100000"), DisplayName = "DistanceField Shadow Distance")
124 float DistanceFieldShadowDistance;
125
130 UPROPERTY(EditAnywhere, AdvancedDisplay, BlueprintReadOnly, Category = Light, meta = (UIMin = "0", ClampMin = "0"))
131 int32 ForwardShadingPriority;
132
137 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category=Light, meta=(UIMin = "0", UIMax = "5"), DisplayName = "Source Angle")
138 float LightSourceAngle;
139
143 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category=Light, meta=(UIMin = "0", UIMax = "5"), DisplayName = "Source Soft Angle")
144 float LightSourceSoftAngle;
145
150 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = RayTracing, meta = (UIMin = "0", UIMax = "5"), DisplayName = "Shadow Source Angle Factor")
151 float ShadowSourceAngleFactor;
152
154 UPROPERTY(EditAnywhere, AdvancedDisplay, BlueprintReadOnly, Category=DistanceFieldShadows, meta=(UIMin = "1000", UIMax = "100000"), DisplayName = "DistanceField Trace Distance")
155 float TraceDistance;
156
157 UPROPERTY()
159
163 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category= AtmosphereAndCloud, meta=(DisplayName = "Atmosphere Sun Light", ShouldShowInViewport = true))
165
169 UPROPERTY(EditAnywhere, AdvancedDisplay, BlueprintReadOnly, Category = AtmosphereAndCloud, meta = (DisplayName = "Atmosphere Sun Light Index", UIMin = "0", UIMax = "1", ClampMin = "0", ClampMax= "1"))
170 int32 AtmosphereSunLightIndex;
171
175 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = AtmosphereAndCloud, AdvancedDisplay, meta = (DisplayName = "Atmosphere Sun Disk Color Scale"))
176 FLinearColor AtmosphereSunDiskColorScale;
177
181 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = AtmosphereAndCloud, AdvancedDisplay)
182 uint32 bPerPixelAtmosphereTransmittance : 1;
183
187 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = AtmosphereAndCloud)
188 uint32 bCastShadowsOnClouds : 1;
192 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = AtmosphereAndCloud)
193 uint32 bCastShadowsOnAtmosphere : 1;
197 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = AtmosphereAndCloud)
198 uint32 bCastCloudShadows : 1;
202 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = AtmosphereAndCloud, AdvancedDisplay, meta = (UIMin = "0", UIMax = "1", ClampMin = "0", SliderExponent = 1.0))
203 float CloudShadowStrength;
207 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = AtmosphereAndCloud, AdvancedDisplay, meta = (UIMin = "0", UIMax = "1", ClampMin = "0", SliderExponent = 1.0))
208 float CloudShadowOnAtmosphereStrength;
212 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = AtmosphereAndCloud, AdvancedDisplay, meta = (UIMin = "0", UIMax = "1", ClampMin = "0", SliderExponent = 1.0))
213 float CloudShadowOnSurfaceStrength;
217 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = AtmosphereAndCloud, AdvancedDisplay, meta = (UIMin = "-1", UIMax = "1"))
218 float CloudShadowDepthBias;
222 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = AtmosphereAndCloud, AdvancedDisplay, meta = (UIMin = "1", ClampMin = "1"))
223 float CloudShadowExtent;
227 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = AtmosphereAndCloud, AdvancedDisplay, meta = (UIMin = "0.25", UIMax = "8", ClampMin = "0.25", SliderExponent = 1.0))
228 float CloudShadowMapResolutionScale;
233 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = AtmosphereAndCloud, AdvancedDisplay, meta = (UIMin = "0.25", UIMax = "8", ClampMin = "0.25", SliderExponent = 1.0))
234 float CloudShadowRaySampleCountScale;
235
239 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = AtmosphereAndCloud, meta = (HideAlphaChannel))
240 FLinearColor CloudScatteredLuminanceScale;
241
243 UPROPERTY(EditAnywhere, Category=Light, meta=(ShowOnlyInnerProperties))
245
249 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Light, AdvancedDisplay, meta = (EditCondition = "Mobility == EComponentMobility::Stationary"))
250 uint32 bCastModulatedShadows : 1;
251
255 UPROPERTY(BlueprintReadOnly, interp, Category = Light, meta = (HideAlphaChannel), AdvancedDisplay)
256 FColor ModulatedShadowColor;
257
261 UPROPERTY(BlueprintReadOnly, interp, Category = Light, meta = (HideAlphaChannel, UIMin = "0", UIMax = "1", ClampMin = "0", ClampMax = "1"), AdvancedDisplay)
262 float ShadowAmount;
263
264 UFUNCTION(BlueprintCallable, Category="Rendering|Lighting")
266
267 UFUNCTION(BlueprintCallable, Category="Rendering|Lighting")
269
270 UFUNCTION(BlueprintCallable, Category="Rendering|Lighting")
272
273 UFUNCTION(BlueprintCallable, Category="Rendering|Lighting")
274 ENGINE_API void SetCascadeDistributionExponent(float NewValue);
275
276 UFUNCTION(BlueprintCallable, Category="Rendering|Lighting")
277 ENGINE_API void SetCascadeTransitionFraction(float NewValue);
278
279 UFUNCTION(BlueprintCallable, Category="Rendering|Lighting")
280 ENGINE_API void SetShadowDistanceFadeoutFraction(float NewValue);
281
282 UFUNCTION(BlueprintCallable, Category = "Rendering|Lighting")
283 ENGINE_API void SetShadowCascadeBiasDistribution(float NewValue);
284
285 UFUNCTION(BlueprintCallable, Category="Rendering|Lighting")
287
288 UFUNCTION(BlueprintCallable, Category="Rendering|Lighting")
289 ENGINE_API void SetOcclusionMaskDarkness(float NewValue);
290
291 UFUNCTION(BlueprintCallable, Category = "Rendering|Lighting")
292 ENGINE_API void SetOcclusionDepthRange(float NewValue);
293
294 UFUNCTION(BlueprintCallable, Category="Rendering|Lighting")
296
297 UFUNCTION(BlueprintCallable, Category = "Rendering|Lighting")
298 ENGINE_API void SetLightSourceAngle(float NewValue);
299
300 UFUNCTION(BlueprintCallable, Category = "Rendering|Lighting")
301 ENGINE_API void SetLightSourceSoftAngle(float NewValue);
302
303 UFUNCTION(BlueprintCallable, Category = "Rendering|Lighting")
304 ENGINE_API void SetShadowSourceAngleFactor(float NewValue);
305
306 UFUNCTION(BlueprintCallable, Category="Rendering|Lighting")
307 ENGINE_API void SetShadowAmount(float NewValue);
308
309 UFUNCTION(BlueprintCallable, Category="Rendering|Lighting")
311
312 UFUNCTION(BlueprintCallable, Category = "Rendering|Lighting")
314
315 UFUNCTION(BlueprintCallable, Category = "Rendering|Lighting")
316 ENGINE_API void SetAtmosphereSunDiskColorScale(FLinearColor NewValue);
317
318 UFUNCTION(BlueprintCallable, Category = "Rendering|Lighting")
320
321 //~ Begin ULightComponent Interface
323 ENGINE_API virtual ELightComponentType GetLightType() const override;
325 {
326 return LightmassSettings;
327 }
328
329 ENGINE_API virtual float GetUniformPenumbraSize() const override;
330
331 ENGINE_API virtual FLightSceneProxy* CreateSceneProxy() const override;
332 virtual bool IsUsedAsAtmosphereSunLight() const override
333 {
334 return bAtmosphereSunLight;
335 }
336 virtual uint8 GetAtmosphereSunLightIndex() const override
337 {
338 return static_cast<uint8>(AtmosphereSunLightIndex);
339 }
340 virtual FLinearColor GetAtmosphereSunDiskColorScale() const override
341 {
342 return AtmosphereSunDiskColorScale;
343 }
344 ENGINE_API virtual ELightUnits GetLightUnits() const;
345 //~ End ULightComponent Interface
346
347 //~ Begin UObject Interface
348#if WITH_EDITOR
349 ENGINE_API virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
350 ENGINE_API virtual bool CanEditChange(const FProperty* InProperty) const override;
351 virtual bool ForceActorNonSpatiallyLoaded() const override { return true; }
352#endif // WITH_EDITOR
353 ENGINE_API virtual void Serialize(FArchive& Ar) override;
354 //~ Begin UObject Interface
355
356 ENGINE_API virtual void InvalidateLightingCacheDetailed(bool bInvalidateBuildEnqueuedLighting, bool bTranslationOnly) override;
357};
358
359
360
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
@ Num
Definition MetalRHIPrivate.h:234
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
ELightComponentType
Definition SceneTypes.h:96
ELightUnits
Definition Scene.h:75
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition LightSceneProxy.h:43
Definition UnrealType.h:174
Definition DistanceFieldAtlas.h:36
Definition EngineTypes.h:3787
Definition SceneManagement.h:73
U16 Index
Definition radfft.cpp:71
Definition Color.h:486
Definition EngineTypes.h:2151
Definition EngineTypes.h:2116
Definition Color.h:48
Definition UnrealType.h:6865