UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GeometryCollectionRenderData.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"
6#include "RawIndexBuffer.h"
11
14
15
18{
19public:
21
22 void Init(TArray<uint16> const& InBoneMap, bool bInNeedsCPUAccess = true);
23 void Serialize(FArchive& Ar, bool bInNeedsCPUAccess);
24 FRHIShaderResourceView* GetSRV() const { return VertexBufferSRV; }
25
26 FORCEINLINE uint16& BoneIndex(uint32 VertexIndex) const
27 {
28 checkSlow(VertexIndex < NumVertices);
29 return *(uint16*)(Data + VertexIndex * PixelFormatStride);
30 }
31
32 SIZE_T GetAllocatedSize() const { return (BoneMapData != nullptr) ? BoneMapData->GetResourceSize() : 0; }
33
34protected:
35 void CleanUp();
36 void AllocateData(bool bInNeedsCPUAccess = true);
38
39 void InitRHI(FRHICommandListBase& RHICmdList) override;
40 void ReleaseRHI() override;
41
43 static const uint32 PixelFormatStride = 2;
44
45private:
46 uint32 NumVertices = 0;
47 bool bNeedsCPUAccess = true;
48 FShaderResourceViewRHIRef VertexBufferSRV = nullptr;
49 FStaticMeshVertexDataInterface* BoneMapData = nullptr;
50 uint8* Data = nullptr;
51};
52
69
88
91{
94
95 // Info on grouped material sections within vertex buffers.
96 // A section has a uniform material index and can contain multiple per-bone subsections.
98 // Info on grouped material sections within vertex buffers but with internal faces added by the fracture tool removed.
100 // Info on individual subsections within vertex buffers.
101 // A subsection has a uniform bone and material index.
103
105 void Serialize(FArchive& Ar);
106};
107
110{
111public:
114
115#if WITH_EDITOR
116 struct FCreateDesc
117 {
118 bool bEnableNanite = false;
119 bool bEnableNaniteFallback = false;
120 bool bUseFullPrecisionUVs = false;
121 bool bConvertVertexColorsToSRGB = false;
122 uint32 NaniteMinimumResidencyInKB = 0;
123 };
124
126#endif
127
129 {
130 return bIsInitialized;
131 }
132
135
138
140 void ReleaseResources();
141
143 bool bHasMeshData = false;
145 bool bHasNaniteData = false;
146
149
152
155
158
159private:
160 bool bIsInitialized = false;
161};
#define FORCEINLINE
Definition AndroidPlatform.h:140
#define checkSlow(expr)
Definition AssertionMacros.h:332
@ ForceInitToZero
Definition CoreMiscDefines.h:156
FPlatformTypes::int16 int16
A 16-bit signed integer.
Definition Platform.h:1123
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
void Init()
Definition LockFreeList.h:4
FBoxSphereBounds3d FBoxSphereBounds
Definition MathFwd.h:142
EPixelFormat
Definition PixelFormat.h:16
@ PF_R16_UINT
Definition PixelFormat.h:49
uint8_t uint8
Definition binka_ue_file_header.h:8
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition GeometryCollectionRenderData.h:18
void ReleaseRHI() override
Definition GeometryCollectionRenderData.cpp:56
void ResizeBuffer(uint32 InNumVertices)
Definition GeometryCollectionRenderData.cpp:33
static const EPixelFormat PixelFormat
Definition GeometryCollectionRenderData.h:42
~FBoneMapVertexBuffer()
Definition GeometryCollectionRenderData.cpp:15
void InitRHI(FRHICommandListBase &RHICmdList) override
Definition GeometryCollectionRenderData.cpp:46
void CleanUp()
Definition GeometryCollectionRenderData.cpp:20
FORCEINLINE uint16 & BoneIndex(uint32 VertexIndex) const
Definition GeometryCollectionRenderData.h:26
SIZE_T GetAllocatedSize() const
Definition GeometryCollectionRenderData.h:32
static const uint32 PixelFormatStride
Definition GeometryCollectionRenderData.h:43
FRHIShaderResourceView * GetSRV() const
Definition GeometryCollectionRenderData.h:24
void AllocateData(bool bInNeedsCPUAccess=true)
Definition GeometryCollectionRenderData.cpp:40
Definition ColorVertexBuffer.h:16
Definition GeometryCollectionRenderData.h:110
~FGeometryCollectionRenderData()
Definition GeometryCollectionRenderData.cpp:706
FBoxSphereBounds PreSkinnedBounds
Definition GeometryCollectionRenderData.h:157
TPimplPtr< Nanite::FResources > NaniteResourcesPtr
Definition GeometryCollectionRenderData.h:154
FGeometryCollectionMeshDescription MeshDescription
Definition GeometryCollectionRenderData.h:151
FGeometryCollectionMeshResources MeshResource
Definition GeometryCollectionRenderData.h:148
void ReleaseResources()
Definition GeometryCollectionRenderData.cpp:803
bool IsInitialized()
Definition GeometryCollectionRenderData.h:128
bool bHasMeshData
Definition GeometryCollectionRenderData.h:143
bool bHasNaniteData
Definition GeometryCollectionRenderData.h:145
void InitResources(UGeometryCollection const &Owner)
Definition GeometryCollectionRenderData.cpp:783
Definition GeometryCollection.h:32
Definition PositionVertexBuffer.h:27
Definition RHICommandList.h:455
Definition RHIResources.h:3304
Definition RawIndexBuffer.h:130
Definition StaticMeshVertexBuffer.h:150
Definition StaticMeshVertexDataInterface.h:22
virtual SIZE_T GetResourceSize() const =0
Definition RenderResource.h:474
Definition Array.h:670
Definition UniquePtr.h:107
Definition GeometryCollectionObject.h:393
Definition GeometryCollectionRenderData.h:91
TArray< FGeometryCollectionMeshElement > Sections
Definition GeometryCollectionRenderData.h:97
TArray< FGeometryCollectionMeshElement > SectionsNoInternal
Definition GeometryCollectionRenderData.h:99
uint32 NumVertices
Definition GeometryCollectionRenderData.h:92
uint32 NumTriangles
Definition GeometryCollectionRenderData.h:93
TArray< FGeometryCollectionMeshElement > SubSections
Definition GeometryCollectionRenderData.h:102
Definition GeometryCollectionRenderData.h:72
uint32 VertexStart
Definition GeometryCollectionRenderData.h:78
int16 TransformIndex
Definition GeometryCollectionRenderData.h:73
uint32 TriangleCount
Definition GeometryCollectionRenderData.h:77
uint8 bIsInternal
Definition GeometryCollectionRenderData.h:75
friend FArchive & operator<<(FArchive &Ar, FGeometryCollectionMeshElement &Item)
Definition GeometryCollectionRenderData.h:82
uint32 TriangleStart
Definition GeometryCollectionRenderData.h:76
uint32 VertexEnd
Definition GeometryCollectionRenderData.h:79
uint8 MaterialIndex
Definition GeometryCollectionRenderData.h:74
Definition GeometryCollectionRenderData.h:55
FBoneMapVertexBuffer BoneMapVertexBuffer
Definition GeometryCollectionRenderData.h:60
FPositionVertexBuffer PositionVertexBuffer
Definition GeometryCollectionRenderData.h:57
FRawStaticIndexBuffer IndexBuffer
Definition GeometryCollectionRenderData.h:56
void InitResources(UGeometryCollection const &Owner)
Definition GeometryCollectionRenderData.cpp:85
FColorVertexBuffer ColorVertexBuffer
Definition GeometryCollectionRenderData.h:59
FStaticMeshVertexBuffer StaticMeshVertexBuffer
Definition GeometryCollectionRenderData.h:58
void ReleaseResources()
Definition GeometryCollectionRenderData.cpp:101
Definition PimplPtr.h:50
Definition BoxSphereBounds.h:25