UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ReflectionCaptureComponent.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 "Misc/Guid.h"
8#include "Misc/CoreStats.h"
11#include "RenderCommandFence.h"
12#include "ReflectionCaptureComponent.generated.h"
13
16class FTexture;
17
18UENUM()
26
27// -> will be exported to EngineDecalClasses.h
28UCLASS(abstract, hidecategories=(Collision, Object, Physics, SceneComponent, Activation, "Components|Activation", Mobility), MinimalAPI)
29class UReflectionCaptureComponent : public USceneComponent
30{
32
33 UPROPERTY()
34 TObjectPtr<UBillboardComponent> CaptureOffsetComponent;
35
37 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=ReflectionCapture)
38 EReflectionSourceType ReflectionSourceType;
39
41 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=ReflectionCapture)
43
45 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=ReflectionCapture, meta = (UIMin = "0", UIMax = "360"))
46 float SourceCubemapAngle;
47
49 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=ReflectionCapture, meta=(UIMin = ".5", UIMax = "4"))
50 float Brightness;
51
53 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=ReflectionCapture, AdvancedDisplay)
54 FVector CaptureOffset;
55
57 UPROPERTY()
58 FGuid MapBuildDataId;
59
61 class FReflectionTextureCubeResource* EncodedHDRCubemapTexture;
62
63#if WITH_EDITOR
66#endif
67
69 FReflectionCaptureProxy* SceneProxy;
70
72 ENGINE_API FReflectionCaptureProxy* CreateSceneProxy();
73
75 virtual void UpdatePreviewShape();
76
78 ENGINE_API void MarkDirtyForRecaptureOrUpload();
79
81 ENGINE_API void MarkDirtyForRecapture();
82
84 void SetCaptureCompleted() { bNeedsRecaptureOrUpload = false; }
85
87 virtual float GetInfluenceBoundingRadius() const PURE_VIRTUAL(UReflectionCaptureComponent::GetInfluenceBoundingRadius,return 0;);
88
93 ENGINE_API static void UpdateReflectionCaptureContents(UWorld* WorldToUpdate, const TCHAR* CaptureReason = nullptr, bool bVerifyOnlyCapturing = false, bool bCapturingForMobile = false, bool bInsideTick = false);
94
95 ENGINE_API class FReflectionCaptureMapBuildData* GetMapBuildData() const;
96
97 virtual void PropagateLightingScenarioChange() override;
98
99 ENGINE_API static int32 GetReflectionCaptureSize();
100
101 //~ Begin UActorComponent Interface
102 virtual void CreateRenderState_Concurrent(FRegisterComponentContext* Context) override;
103 virtual void DestroyRenderState_Concurrent() override;
104 virtual void SendRenderTransform_Concurrent() override;
105 virtual void OnRegister() override;
106 virtual void InvalidateLightingCacheDetailed(bool bInvalidateBuildEnqueuedLighting, bool bTranslationOnly) override;
107 //~ End UActorComponent Interface
108
109 //~ Begin UObject Interface
110 virtual void PostInitProperties() override;
111 virtual void Serialize(FArchive& Ar) override;
112#if WITH_EDITOR
113 virtual bool CanEditChange(const FProperty* Property) const override;
114 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
116#endif // WITH_EDITOR
117 virtual void BeginDestroy() override;
118 virtual bool IsReadyForFinishDestroy() override;
119 virtual void FinishDestroy() override;
120 //~ End UObject Interface
121
122private:
123
125 bool bNeedsRecaptureOrUpload;
126
128 float CachedAverageBrightness;
129
131 FRenderCommandFence ReleaseResourcesFence;
132
138 static TArray<UReflectionCaptureComponent*> ReflectionCapturesToUpdate;
139
145 static TArray<UReflectionCaptureComponent*> ReflectionCapturesToUpdateForLoad;
146 static FCriticalSection ReflectionCapturesToUpdateForLoadLock;
147
148 //void UpdateDerivedData(FReflectionCaptureFullHDR* NewDerivedData);
149 void SerializeLegacyData(FArchive& Ar);
150
151 void SafeReleaseEncodedHDRCubemapTexture();
152
154};
155
#define PURE_VIRTUAL(func,...)
Definition CoreMiscDefines.h:103
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
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
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
EReflectionSourceType
Definition ReflectionCaptureComponent.h:20
ENGINE_API void GenerateEncodedHDRData(const TArray< uint8 > &FullHDRData, int32 CubemapSize, TArray< uint8 > &OutEncodedHDRData)
Definition ReflectionCaptureComponent.cpp:520
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Archive.h:1208
Definition UnrealType.h:174
Definition MapBuildDataRegistry.h:233
Definition ReflectionCaptureProxy.h:31
Definition ReflectionCaptureComponent.cpp:574
Definition ActorComponent.h:47
Definition RenderCommandFence.h:15
Definition RenderResource.h:354
Definition Array.h:670
Definition ReflectionCaptureComponent.h:30
Definition World.h:918
Type
Definition RHIFeatureLevel.h:20
Definition Guid.h:109
Definition UnrealType.h:6865
Definition ObjectPtr.h:488