UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VolumetricCloudComponent.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"
11
12#include "VolumetricCloudComponent.generated.h"
13
14
16
17UENUM()
23
27UCLASS(ClassGroup = Rendering, collapsecategories, hidecategories = (Object, Mobility, Activation, "Components|Activation"), editinlinenew, meta = (BlueprintSpawnableComponent), MinimalAPI)
28class UVolumetricCloudComponent : public USceneComponent
29{
31
33
35 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Layer", meta = (UIMin = 0.0f, UIMax = 20.0f, SliderExponent = 2.0))
37
39 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Layer", meta = (UIMin = 0.1f, UIMax = 20.0f, ClampMin = 0.1, SliderExponent = 2.0))
40 float LayerHeight;
41
43 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Layer", meta = (UIMin = 100.0f, UIMax = 500.0f, ClampMin = 1.0f, SliderExponent = 2.0))
44 float TracingStartMaxDistance;
45
47 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Layer", meta = (UIMin = 0.0f, UIMax = 100.0f, ClampMin = 0.0f, SliderExponent = 3.0))
48 float TracingStartDistanceFromCamera;
49
51 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Layer")
52 EVolumetricCloudTracingMaxDistanceMode TracingMaxDistanceMode;
53
55 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Layer", meta = (UIMin = 1.0f, UIMax = 500.0f, ClampMin = 0.1f, SliderExponent = 2.0))
56 float TracingMaxDistance;
57
59 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Planet", meta = (UIMin = 100.0f, UIMax = 7000.0f, ClampMin = 0.1, ClampMax = 10000.0f))
60 float PlanetRadius;
61
66 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Planet", meta = (HideAlphaChannel))
67 FColor GroundAlbedo;
68
70 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Cloud Material")
72
74 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Cloud Tracing")
75 uint32 bUsePerSampleAtmosphericLightTransmittance : 1;
76 // bUsePerSampleAtmosphericLightTransmittance is there on the cloud component and not on the light because otherwise we would need optimization permutations of the cloud shader.
77 // And this for the two atmospheric lights ON or OFF. Keeping it simple for now because this changes the look of the cloud, so it is an art/look decision.
78
80 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Cloud Tracing", meta = (UIMin = 0.0f, UIMax = 1.0f, ClampMin = 0.0f, ClampMax = 1.0f))
81 float SkyLightCloudBottomOcclusion;
82
87 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Cloud Tracing", meta = (UIMin = "0.05", UIMax = "8", ClampMin = "0.05", SliderExponent = 1.0))
88 float ViewSampleCountScale;
93 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Cloud Tracing", meta = (UIMin = "0.05", UIMax = "8", ClampMin = "0.05", SliderExponent = 1.0))
95 UPROPERTY()
97 UPROPERTY()
99
104 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Cloud Tracing", meta = (UIMin = "0.05", UIMax = "8", ClampMin = "0.05", SliderExponent = 1.0))
105 float ShadowViewSampleCountScale;
110 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Cloud Tracing", meta = (UIMin = "0.05", UIMax = "8", ClampMin = "0.05", SliderExponent = 1.0))
112 UPROPERTY()
114 UPROPERTY()
116
120 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Cloud Tracing", meta = (UIMin = "0.1", UIMax = "50", ClampMin = "0.01", SliderExponent = 3.0))
121 float ShadowTracingDistance;
122
126 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Cloud Tracing", meta = (UIMin = "0.0", UIMax = "1.0", ClampMin = "0.0", ClampMax = "1.0", SliderExponent = 5.0))
127 float StopTracingTransmittanceThreshold;
128
130 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Art Direction", meta = (UIMin = 0.0, UIMax = 100.0, ClampMin = 0.0, SliderExponent = 2.0))
131 float AerialPespectiveRayleighScatteringStartDistance;
133 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Art Direction", meta = (UIMin = 0.0, UIMax = 100.0, ClampMin = 0.0, SliderExponent = 2.0))
134 float AerialPespectiveRayleighScatteringFadeDistance;
136 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Art Direction", meta = (UIMin = 0.0, UIMax = 100.0, ClampMin = 0.0, SliderExponent = 2.0))
137 float AerialPespectiveMieScatteringStartDistance;
139 UPROPERTY(EditAnywhere, BlueprintReadOnly, interp, Category = "Art Direction", meta = (UIMin = 0.0, UIMax = 100.0, ClampMin = 0.0, SliderExponent = 2.0))
140 float AerialPespectiveMieScatteringFadeDistance;
141
143 UPROPERTY(EditAnywhere, AdvancedDisplay, BlueprintReadOnly, Category = Rendering, Interp)
144 uint8 bHoldout : 1;
145
147 UPROPERTY(EditAnywhere, AdvancedDisplay, BlueprintReadOnly, Category = Rendering)
148 uint8 bRenderInMainPass : 1;
149
151 UPROPERTY(EditAnywhere, AdvancedDisplay, BlueprintReadOnly, Category = Rendering)
152 uint8 bVisibleInRealTimeSkyCaptures : 1;
153
154
155 UFUNCTION(BlueprintCallable, Category = "Rendering")
156 ENGINE_API void SetLayerBottomAltitude(float NewValue);
157 UFUNCTION(BlueprintCallable, Category = "Rendering")
158 ENGINE_API void SetLayerHeight(float NewValue);
159 UFUNCTION(BlueprintCallable, Category = "Rendering")
160 ENGINE_API void SetTracingStartMaxDistance(float NewValue);
161 UFUNCTION(BlueprintCallable, Category = "Rendering")
163 UFUNCTION(BlueprintCallable, Category = "Rendering")
164 ENGINE_API void SetTracingMaxDistance(float NewValue);
165 UFUNCTION(BlueprintCallable, Category = "Rendering")
166 ENGINE_API void SetPlanetRadius(float NewValue);
167 UFUNCTION(BlueprintCallable, Category = "Rendering")
168 ENGINE_API void SetGroundAlbedo(FColor NewValue);
169 UFUNCTION(BlueprintCallable, Category = "Rendering", meta = (DisplayName = "Set Use Per Sample Atmospheric Light Transmittance"))
171 UFUNCTION(BlueprintCallable, Category = "Rendering")
172 ENGINE_API void SetSkyLightCloudBottomOcclusion(float NewValue);
173 UFUNCTION(BlueprintCallable, Category = "Rendering")
174 ENGINE_API void SetViewSampleCountScale(float NewValue);
175 UFUNCTION(BlueprintCallable, Category = "Rendering")
177 UFUNCTION(BlueprintCallable, Category = "Rendering")
178 ENGINE_API void SetShadowViewSampleCountScale(float NewValue);
179 UFUNCTION(BlueprintCallable, Category = "Rendering")
181 UFUNCTION(BlueprintCallable, Category = "Rendering")
182 ENGINE_API void SetShadowTracingDistance(float NewValue);
183 UFUNCTION(BlueprintCallable, Category = "Rendering")
185 UFUNCTION(BlueprintCallable, Category = "Rendering")
186 ENGINE_API void SetMaterial(UMaterialInterface* NewValue);
187
188 UMaterialInterface* GetMaterial() const { return MaterialLifetimePtr.Get(); }
189
190 // Deprecated functions but still valid because they forward data correctly.
191 UE_DEPRECATED(5.0, "This function has been replaced by SetReflectionViewSampleCountScale.")
192 UFUNCTION(BlueprintCallable, Category = "Rendering", meta = (DeprecatedFunction, DeprecationMessage = "This function has been replaced by SetReflectionViewSampleCountScale."))
193 ENGINE_API void SetReflectionSampleCountScale(float NewValue);
194 UE_DEPRECATED(5.0, "This function has been replaced by SetShadowReflectionViewSampleCountScale.")
195 UFUNCTION(BlueprintCallable, Category = "Rendering", meta = (DeprecatedFunction, DeprecationMessage = "This function has been replaced by SetShadowReflectionViewSampleCountScale."))
197
198 UFUNCTION(BlueprintCallable, Category = "Rendering")
200
201 UFUNCTION(BlueprintCallable, Category = "Rendering")
202 ENGINE_API void SetRenderInMainPass(bool bValue);
203
204 UFUNCTION(BlueprintCallable, Category = "Rendering")
206
207
209 //~ Begin UActorComponent Interface.
210 virtual void CreateRenderState_Concurrent(FRegisterComponentContext* Context) override;
211 virtual void DestroyRenderState_Concurrent() override;
212 virtual void OnRegister() override;
213 virtual void PrecachePSOs() override;
214 //~ End UActorComponent Interface.
215
216public:
217
218 //~ Begin UObject Interface.
221#if WITH_EDITOR
222 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
223 virtual void OnCookEvent(UE::Cook::ECookEvent CookEvent, UE::Cook::FCookEventContext& CookContext) override;
224#endif // WITH_EDITOR
225 //~ End UObject Interface
226
227 //~ Begin UActorComponent Interface.
228#if WITH_EDITOR
229 virtual void CheckForErrors() override;
230#endif // WITH_EDITOR
231 //~ End UActorComponent Interface.
232
233
234 // Those values should never be changed wihtout data conversion, that in order to maintain performance in case default values are used.
235 static constexpr float BaseViewRaySampleCount = 96.0f;
236 static constexpr float BaseShadowRaySampleCount = 10.0f;
237 // Those values are part of a data conversion and should never be changed. CVars and component sample count controls should be enough.
238 static constexpr float OldToNewReflectionViewRaySampleCount = 10.0f / BaseViewRaySampleCount;
240
241private:
242
243 FVolumetricCloudSceneProxy* VolumetricCloudSceneProxy;
244
245 // The material is assigned to a regular pointer so that the garbage collector to not get ride of it.
246 UPROPERTY()
248
249};
250
251
257class AVolumetricCloud : public AInfo
258{
260
261private:
262
263 UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = Atmosphere, meta = (AllowPrivateAccess = "true"))
265
266#if WITH_EDITOR
267 virtual bool ActorTypeSupportsDataLayer() const override { return true; }
268#endif
269
270};
OODEFFUNC typedef const int const char * function
Definition oodle2.h:710
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
#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
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
EVolumetricCloudTracingMaxDistanceMode
Definition VolumetricCloudComponent.h:19
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 ActorComponent.h:47
Definition VolumetricCloudProxy.h:21
Definition MaterialInterface.h:296
Definition Color.h:486
Definition UnrealType.h:6865
Definition ObjectPtr.h:488
Definition SoftObjectPtr.h:174
Definition AndroidInputInterface.h:145