UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GeometryCollectionRenderLevelSetActor.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#include "Chaos/Levelset.h"
10#include "Engine/StaticMesh.h"
13
14#include "GeometryCollectionRenderLevelSetActor.generated.h"
15
16
27UCLASS(MinimalAPI)
29{
31public:
32
34
35 // Volume texture to fill
36 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Volume")
37 TObjectPtr<UVolumeTexture> TargetVolumeTexture;
38
39 // Material that performs ray marching. Note this must have certain parameters in order
40 // to work correctly
41 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Rendering")
42 TObjectPtr<UMaterial> RayMarchMaterial;
43
44 // Surface tolerance used for rendering. When surface reconstruction is noisy,
45 // try tweaking this value
46 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Rendering")
47 float SurfaceTolerance;
48
49 // Isovalue of the level set to use for surface reconstruction. Generally you want
50 // this to be zero, but it can be useful for exploring the distance values to make
51 // this negative to see the interior structure of the levelset
52 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Rendering")
53 float Isovalue;
54
55 // Enable or disable rendering
56 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Rendering")
57 bool Enabled;
58
59 // Enable or disable rendering
60 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Rendering")
61 bool RenderVolumeBoundingBox;
62
63 // Find/create the level set renderer singleton actor as required. Return whether the found or created actor.
65
66 // Load a new level set to render
67 GEOMETRYCOLLECTIONENGINE_API bool SetLevelSetToRender(const Chaos::FLevelSet &LevelSet, const FTransform &LocalToWorld);
68
69 // Sync level set transform to the render material
70 GEOMETRYCOLLECTIONENGINE_API void SyncLevelSetTransform(const FTransform &LocalToWorld);
71
72 // Some initialization happens in here
74
75#if WITH_EDITOR
76 // Allowed for live updates to parameters from inside the editor when ejected
77 GEOMETRYCOLLECTIONENGINE_API virtual void PostEditChangeProperty(struct FPropertyChangedEvent& e) override;
78#endif
79
80 // set and sync enabled
81 void SetEnabled(bool enabled)
82 {
83 Enabled = enabled;
84 PostProcessComponent->bEnabled = Enabled;
85 }
86
87private:
88 FVector MinBBoxCorner;
89 FVector MaxBBoxCorner;
90
91 FMatrix WorldToLocal;
92
93 float VoxelSize;
94
95 UPostProcessComponent *PostProcessComponent;
96
97 // Dynamic material instance so we can update parameters based on volume changes
98 UMaterialInstanceDynamic* DynRayMarchMaterial;
99
100 // Synchronizes the state of this actor class with the post process render material
101 GEOMETRYCOLLECTIONENGINE_API void SyncMaterialParameters();
102
103 // Private for now since step size mult might not be super useful due to the current
104 // rendering algorithms employed in the shaders
105 // @todo: expose this in a meaningful way in the future if necessary
106 // UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Rendering")
107 float StepSizeMult;
108};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition Actor.h:257
Definition GeometryCollectionRenderLevelSetActor.h:29
void SetEnabled(bool enabled)
Definition GeometryCollectionRenderLevelSetActor.h:81
static GEOMETRYCOLLECTIONENGINE_API int InstanceCount
Definition GeometryCollectionRenderLevelSetActor.h:33
Definition MaterialInstanceDynamic.h:15
Definition Material.h:432
Definition VolumeTexture.h:17
Definition World.h:918
Definition SkeletalMeshComponent.h:307
Definition UnrealType.h:6865
Definition ObjectPtr.h:488