UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SkyAtmosphereComponent.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"
7#include "EngineDefines.h"
9#include "Misc/Guid.h"
10#include "RenderResource.h"
12
13#include "SkyAtmosphereComponent.generated.h"
14
15
17
18
19USTRUCT(BlueprintType)
21{
23
24 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Tent", meta = (UIMin = 0.0, UIMax = 60.0))
25 float TipAltitude = 0.0f;
26
27 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Tent", meta = (UIMin = 0.0, UIMax = 1.0, ClampMin = 0.0, SliderExponent = 4.0))
28 float TipValue = 0.0f;
29
30 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Tent", meta = (UIMin = 0.01, UIMax = 20.0, ClampMin = 0.0))
31 float Width = 1.0f;
32};
33
34UENUM()
41
46UCLASS(ClassGroup = Rendering, collapsecategories, hidecategories = (Object, Mobility, Activation, "Components|Activation"), editinlinenew, meta = (BlueprintSpawnableComponent), MinimalAPI)
47class USkyAtmosphereComponent : public USceneComponent
48{
50
52
53
55 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Planet", meta = (HideAlphaChannel))
56 ESkyAtmosphereTransformMode TransformMode;
57
59 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Planet", meta = (DisplayName = "Ground Radius", UIMin = 1.0, UIMax = 7000.0, ClampMin = 0.1, ClampMax = 10000.0, SliderExponent = 5.0))
60 float BottomRadius;
61
63 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Planet", meta = (HideAlphaChannel))
64 FColor GroundAlbedo;
65
66
67
69 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Atmosphere", meta = (UIMin = 1.0, UIMax = 200.0, ClampMin = 0.1, SliderExponent = 2.0))
70 float AtmosphereHeight;
71
76 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Atmosphere", meta = (DisplayName = "MultiScattering", UIMin = 0.0, UIMax = 2.0, ClampMin = 0.0, ClampMax = 100.0))
77 float MultiScatteringFactor;
78
85 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Atmosphere", AdvancedDisplay, meta = (UIMin = "0.25", UIMax = "8", ClampMin = "0.25", SliderExponent = 3.0))
86 float TraceSampleCountScale;
87
88
89
91 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Atmosphere - Rayleigh", meta = (UIMin = 0.0, UIMax = 2.0, ClampMin = 0.0, SliderExponent = 4.0))
92 float RayleighScatteringScale;
93
95 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Atmosphere - Rayleigh", meta=(HideAlphaChannel))
96 FLinearColor RayleighScattering;
97
99 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Atmosphere - Rayleigh", meta = (UIMin = 0.01, UIMax = 20.0, ClampMin = 0.001, SliderExponent = 5.0))
100 float RayleighExponentialDistribution;
101
102
103
105 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Atmosphere - Mie", meta = (UIMin = 0.0, UIMax = 5.0, ClampMin = 0.0, SliderExponent = 4.0))
106 float MieScatteringScale;
107
109 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Atmosphere - Mie", meta = (HideAlphaChannel))
110 FLinearColor MieScattering;
111
113 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Atmosphere - Mie", meta = (UIMin = 0.0, UIMax = 5.0, ClampMin = 0.0, SliderExponent = 4.0))
114 float MieAbsorptionScale;
115
117 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Atmosphere - Mie", meta = (HideAlphaChannel))
118 FLinearColor MieAbsorption;
119
121 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Atmosphere - Mie", meta = (UIMin = 0.0, UIMax = 0.999, ClampMin = 0.0, ClampMax = 0.999))
122 float MieAnisotropy;
123
125 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Atmosphere - Mie", meta = (UIMin = 0.01, UIMax = 10.0, ClampMin = 0.001, SliderExponent = 5.0))
126 float MieExponentialDistribution;
127
128
129
131 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Atmosphere - Absorption", meta = (DisplayName = "Absorption Scale", UIMin = 0.0, UIMax = 0.2, ClampMin = 0.0, SliderExponent = 3.0))
132 float OtherAbsorptionScale;
133
135 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Atmosphere - Absorption", meta = (DisplayName = "Absorption", HideAlphaChannel))
136 FLinearColor OtherAbsorption;
137
139 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Atmosphere - Absorption", meta = (DisplayName = "Tent Distribution"))
141
142
143
145 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Art Direction", meta = (HideAlphaChannel))
146 FLinearColor SkyLuminanceFactor;
147
149 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Art Direction", meta = (HideAlphaChannel))
150 FLinearColor SkyAndAerialPerspectiveLuminanceFactor;
151
153 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Art Direction", meta = (DisplayName = "Aerial Perspective View Distance Scale", UIMin = 0.0, UIMax = 3.0, ClampMin = 0.0, SliderExponent = 2.0))
154 float AerialPespectiveViewDistanceScale;
155
157 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Art Direction", meta = (UIMin = 0.0, UIMax = 1.0, ClampMin = 0.0, SliderExponent = 2.0))
158 float HeightFogContribution;
159
161 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Art Direction", meta = (UIMin = -90.0, UIMax = 90.0, ClampMin = -90.0f, ClampMax = 90.0f))
162 float TransmittanceMinLightElevationAngle;
163
165 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Art Direction", meta = (UIMin = 0.001f, UIMax = 10.0f, ClampMin = 0.001f))
166 float AerialPerspectiveStartDepth;
167
169 UPROPERTY(EditAnywhere, AdvancedDisplay, BlueprintReadOnly, Category = Rendering, Interp)
170 uint8 bHoldout : 1;
171
173 UPROPERTY(EditAnywhere, AdvancedDisplay, BlueprintReadOnly, Category = Rendering)
174 uint8 bRenderInMainPass : 1;
175
176
177 UFUNCTION(BlueprintCallable, Category = "Rendering")
179 UFUNCTION(BlueprintCallable, Category = "Rendering")
181 UFUNCTION(BlueprintCallable, Category = "Rendering")
183 UFUNCTION(BlueprintCallable, Category = "Rendering")
185
186 UFUNCTION(BlueprintCallable, Category = "Rendering", meta = (DisplayName = "Set Ground Radius"))
187 ENGINE_API void SetBottomRadius(float NewValue);
188 UFUNCTION(BlueprintCallable, Category = "Rendering")
189 ENGINE_API void SetGroundAlbedo(const FColor& NewValue);
190
191 UFUNCTION(BlueprintCallable, Category = "Rendering")
192 ENGINE_API void SetAtmosphereHeight(float NewValue);
193 UFUNCTION(BlueprintCallable, Category = "Rendering")
194 ENGINE_API void SetMultiScatteringFactor(float NewValue);
195
196 UFUNCTION(BlueprintCallable, Category = "Rendering")
197 ENGINE_API void SetRayleighScatteringScale(float NewValue);
198 UFUNCTION(BlueprintCallable, Category = "Rendering")
200 UFUNCTION(BlueprintCallable, Category = "Rendering")
202
203 UFUNCTION(BlueprintCallable, Category = "Rendering")
204 ENGINE_API void SetMieScatteringScale(float NewValue);
205 UFUNCTION(BlueprintCallable, Category = "Rendering")
207 UFUNCTION(BlueprintCallable, Category = "Rendering")
208 ENGINE_API void SetMieAbsorptionScale(float NewValue);
209 UFUNCTION(BlueprintCallable, Category = "Rendering")
211 UFUNCTION(BlueprintCallable, Category = "Rendering")
212 ENGINE_API void SetMieAnisotropy(float NewValue);
213 UFUNCTION(BlueprintCallable, Category = "Rendering")
214 ENGINE_API void SetMieExponentialDistribution(float NewValue);
215
216 UFUNCTION(BlueprintCallable, Category = "Rendering", meta = (DisplayName = "Set Absorption Scale"))
217 ENGINE_API void SetOtherAbsorptionScale(float NewValue);
218 UFUNCTION(BlueprintCallable, Category = "Rendering", meta = (DisplayName = "Set Absorption"))
220
221 UFUNCTION(BlueprintCallable, Category = "Rendering")
223 UFUNCTION(BlueprintCallable, Category = "Rendering")
225 UFUNCTION(BlueprintCallable, Category = "Rendering")
227 UFUNCTION(BlueprintCallable, Category = "Rendering")
228 ENGINE_API void SetAerialPerspectiveStartDepth(float NewValue);
229 UFUNCTION(BlueprintCallable, Category = "Rendering")
230 ENGINE_API void SetHeightFogContribution(float NewValue);
231
232 UFUNCTION(BlueprintCallable, Category = "Rendering")
234
235 UFUNCTION(BlueprintCallable, Category = "Rendering")
237
238 UFUNCTION(BlueprintCallable, Category = "Rendering")
239 ENGINE_API void SetRenderInMainPass(bool bValue);
240
241 UFUNCTION(BlueprintCallable, Category = "Utilities", meta = (DisplayName = "Get Atmosphere Transmitance On Ground At Planet Top"))
243
244 // This function can be used for instance in order to evaluate a directional atmospheric light outer space illuminance for a desired illuminance on ground given a direction.
245 // This is given for the position at the top of the virtual planet. Plus the output outer space illuminance into the light intensity.
246 UFUNCTION(BlueprintCallable, Category = "Utilities", meta = (DisplayName = "Get Atmospheric Light To Match Illuminance On Ground"))
247 ENGINE_API float GetAtmosphericLightToMatchIlluminanceOnGround(FVector LightDirection = FVector(0.0f, 0.0f, 1.0f), float IlluminanceOnGround = 1.0);
248
249 // This is used to position the SkyAtmosphere similarly to the deprecated AtmosphericFog component
251
253 //~ Begin UActorComponent Interface.
254 virtual void CreateRenderState_Concurrent(FRegisterComponentContext* Context) override;
255 virtual void SendRenderTransform_Concurrent() override;
256 virtual void DestroyRenderState_Concurrent() override;
257 //~ End UActorComponent Interface.
258
259public:
260
261 //~ Begin UObject Interface.
263#if WITH_EDITOR
264 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
265#endif // WITH_EDITOR
266 //~ End UObject Interface
267
268 //~ Begin UActorComponent Interface.
269#if WITH_EDITOR
270 virtual void CheckForErrors() override;
271#endif // WITH_EDITOR
272 //~ End UActorComponent Interface.
273
275
276 void GetOverrideLightStatus(bool* OverrideAtmosphericLight, FVector* OverrideAtmosphericLightDirection) const;
277
278private:
279
280 FSkyAtmosphereSceneProxy* SkyAtmosphereSceneProxy;
281
282 bool OverrideAtmosphericLight[NUM_ATMOSPHERE_LIGHTS];
283 FVector OverrideAtmosphericLightDirection[NUM_ATMOSPHERE_LIGHTS];
284
289 UPROPERTY()
299
301
303 // When true, this means that this SkyAtmosphere is use as replacement for the deprecated AtmosphericFogComponent as a parent class.
304 // This is used to adapt the serialisation.
306
312
313 #if WITH_STATE_STREAM_ACTOR
315 #endif
316};
317
318
323UCLASS(showcategories = (Movement, Rendering, Transformation, DataLayers, "Input|MouseInput", "Input|TouchInput"), ClassGroup = Fog, hidecategories = (Info, Object, Input), MinimalAPI)
324class ASkyAtmosphere : public AInfo
325{
327
328private:
329#if WITH_EDITOR
330 virtual bool ActorTypeSupportsDataLayer() const override { return true; }
331#endif
332
333 UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = Atmosphere, meta = (AllowPrivateAccess = "true"))
335
336#if WITH_EDITORONLY_DATA
338 UPROPERTY()
340#endif
341
342public:
343
345 USkyAtmosphereComponent* GetComponent() const { return SkyAtmosphereComponent; }
346
347};
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
#define NUM_ATMOSPHERE_LIGHTS
Definition EngineDefines.h:26
@ Top
Definition MaterialExpressionFunctionInput.h:42
#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
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
ESkyAtmosphereTransformMode
Definition SkyAtmosphereComponent.h:36
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Archive.h:1208
Definition ActorComponent.h:47
Definition SkyAtmosphereSceneProxy.h:16
@ false
Definition radaudio_common.h:23
Definition Color.h:486
Definition Guid.h:109
Definition Color.h:48
Definition UnrealType.h:6865
Definition SkyAtmosphereStateStreamHandle.h:15
Definition SkyAtmosphereComponent.h:21
Definition ObjectPtr.h:488