UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GeometryCollectionRendering.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6#include "EngineGlobals.h"
12
15 SHADER_PARAMETER(uint32,LODLightmapDataIndex)
21
23
29
31
33{
35public:
36 void Bind(const FShaderParameterMap& ParameterMap)
37 {
38 }
39
40 void GetElementShaderBindings(
42 const FSceneView* View,
45 ERHIFeatureLevel::Type FeatureLevel,
46 const FVertexFactory* VertexFactory,
48 class FMeshDrawSingleShaderBindings& ShaderBindings,
49 FVertexInputStreamArray& VertexStreams) const;
50
51};
52
57{
59
60public:
67
68 // Data includes what we need for transform and everything in local vertex factory too
75
76 //
77 // Permutations are controlled by the material flag
78 //
80
81 //
82 // Modify compile environment to enable instancing
83 // @param OutEnvironment - shader compile environment to modify
84 //
86
88
90
91 //
92 // Set the data on the vertex factory
93 //
94 void SetData(FRHICommandListBase& RHICmdList, const FDataType& InData)
95 {
96 Data = InData;
97 UpdateRHI(RHICmdList);
98 }
99
100 //
101 // Copy the data from another vertex factory
102 // @param Other - factory to copy from
103 //
105 {
106 FGeometryCollectionVertexFactory* VertexFactory = this;
107 const FDataType* DataCopy = &Other.Data;
109 [VertexFactory, DataCopy](FRHICommandListImmediate& RHICmdList)
110 {
111 VertexFactory->Data = *DataCopy;
112 });
114 }
115
116 // FRenderResource interface.
117 ENGINE_API virtual void InitRHI(FRHICommandListBase& RHICmdList) override;
118 ENGINE_API virtual void ReleaseRHI() override;
119
121 {
122 return Data.PositionComponentSRV;
123 }
124
126 {
127 return Data.TangentsSRV;
128 }
129
131 {
132 return Data.TextureCoordinatesSRV;
133 }
134
136 {
137 return Data.ColorComponentsSRV;
138 }
139
140 inline const uint32 GetColorIndexMask() const
141 {
142 return Data.ColorIndexMask;
143 }
144
145 inline const int GetLightMapCoordinateIndex() const
146 {
147 return Data.LightMapCoordinateIndex;
148 }
149
150 inline const int GetNumTexcoords() const
151 {
152 return Data.NumTexCoords;
153 }
154
156 {
157 return UniformBuffer.GetReference();
158 }
159
164
165 inline void SetBoneTransformSRV(FRHIShaderResourceView* BoneTransformSRV)
166 {
167 Data.BoneTransformSRV = BoneTransformSRV;
168 }
169
171 {
172 return Data.BoneTransformSRV;
173 }
174
175 inline void SetBonePrevTransformSRV(FRHIShaderResourceView* BonePrevTransformSRV)
176 {
177 Data.BonePrevTransformSRV = BonePrevTransformSRV;
178 }
179
181 {
182 return Data.BonePrevTransformSRV;
183 }
184
185 inline void SetBoneMapSRV(FRHIShaderResourceView* BoneMapSRV)
186 {
187 Data.BoneMapSRV = BoneMapSRV;
188 }
189
191 {
192 return Data.BoneMapSRV;
193 }
194
197
198 static ENGINE_API bool UseShaderBoneTransform(EShaderPlatform ShaderPlatform);
199
200private:
201 FDataType Data;
203 int32 ColorStreamIndex = INDEX_NONE;
204};
@ INDEX_NONE
Definition CoreMiscDefines.h:150
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 DECLARE_TYPE_LAYOUT(T, Interface)
Definition MemoryLayout.h:557
EShaderPlatform
Definition RHIShaderPlatform.h:11
void BeginUpdateResourceRHI(FRenderResource *Resource, FRenderCommandPipe *RenderCommandPipe)
Definition RenderResource.cpp:302
#define ENQUEUE_RENDER_COMMAND(Type)
Definition RenderingThread.h:1167
#define END_GLOBAL_SHADER_PARAMETER_STRUCT
Definition ShaderParameterMacros.h:1669
#define SHADER_PARAMETER_SRV(ShaderType, MemberName)
Definition ShaderParameterMacros.h:1720
#define BEGIN_GLOBAL_SHADER_PARAMETER_STRUCT
Definition ShaderParameterMacros.h:1663
#define SHADER_PARAMETER(MemberType, MemberName)
Definition ShaderParameterMacros.h:1684
EVertexInputStreamType
Definition VertexFactory.h:128
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition GeometryCollectionRendering.h:33
void Bind(const FShaderParameterMap &ParameterMap)
Definition GeometryCollectionRendering.h:36
Definition MeshDrawShaderBindings.h:104
Definition MeshMaterialShader.h:68
Definition RHICommandList.h:455
Definition RHICommandList.h:4626
Definition RHIResources.h:3304
Definition RHIResources.h:1232
RENDERCORE_API void UpdateRHI(FRHICommandListBase &RHICmdList)
Definition RenderResource.cpp:225
Definition SceneInterface.h:106
Definition SceneView.h:1425
Definition ShaderCore.h:323
Definition VertexFactory.h:172
Definition VertexFactory.h:314
Definition VertexFactory.h:661
UE_FORCEINLINE_HINT ReferencedType * GetReference() const
Definition RefCounting.h:584
Definition ShaderParameterMacros.h:136
Type
Definition RHIFeatureLevel.h:20
Definition GeometryCollectionRendering.h:70
FRHIShaderResourceView * BonePrevTransformSRV
Definition GeometryCollectionRendering.h:72
FRHIShaderResourceView * BoneMapSRV
Definition GeometryCollectionRendering.h:73
FRHIShaderResourceView * BoneTransformSRV
Definition GeometryCollectionRendering.h:71
Definition GeometryCollectionRendering.h:57
FRHIShaderResourceView * GetTangentsSRV() const
Definition GeometryCollectionRendering.h:125
static ENGINE_API void ValidateCompiledResult(const FVertexFactoryType *Type, EShaderPlatform Platform, const FShaderParameterMap &ParameterMap, TArray< FString > &OutErrors)
Definition GeometryCollectionRendering.cpp:84
void SetBoneTransformSRV(FRHIShaderResourceView *BoneTransformSRV)
Definition GeometryCollectionRendering.h:165
FRHIShaderResourceView * GetColorComponentsSRV() const
Definition GeometryCollectionRendering.h:135
FRHIShaderResourceView * GetBonePrevTransformSRV() const
Definition GeometryCollectionRendering.h:180
FRHIShaderResourceView * GetTextureCoordinatesSRV() const
Definition GeometryCollectionRendering.h:130
static ENGINE_API void GetPSOPrecacheVertexFetchElements(EVertexInputStreamType VertexInputStreamType, FVertexDeclarationElementList &Elements)
Definition GeometryCollectionRendering.cpp:94
bool EnableLooseParameter
Definition GeometryCollectionRendering.h:196
DECLARE_VERTEX_FACTORY_TYPE_API(FGeometryCollectionVertexFactory, ENGINE_API)
const int GetNumTexcoords() const
Definition GeometryCollectionRendering.h:150
void SetBoneMapSRV(FRHIShaderResourceView *BoneMapSRV)
Definition GeometryCollectionRendering.h:185
static ENGINE_API bool UseShaderBoneTransform(EShaderPlatform ShaderPlatform)
Definition GeometryCollectionRendering.cpp:35
const uint32 GetColorIndexMask() const
Definition GeometryCollectionRendering.h:140
static ENGINE_API void ModifyCompilationEnvironment(const FVertexFactoryShaderPermutationParameters &Parameters, FShaderCompilerEnvironment &OutEnvironment)
Definition GeometryCollectionRendering.cpp:60
FRHIUniformBuffer * GetUniformBuffer() const
Definition GeometryCollectionRendering.h:155
FUniformBufferRHIRef LooseParameterUniformBuffer
Definition GeometryCollectionRendering.h:195
static ENGINE_API bool ShouldCompilePermutation(const FVertexFactoryShaderPermutationParameters &Parameters)
Definition GeometryCollectionRendering.cpp:40
const int GetLightMapCoordinateIndex() const
Definition GeometryCollectionRendering.h:145
FRHIShaderResourceView * GetBoneMapSRV() const
Definition GeometryCollectionRendering.h:190
FUniformBufferRHIRef GetLooseParameterBuffer() const
Definition GeometryCollectionRendering.h:160
FRHIShaderResourceView * GetBoneTransformSRV() const
Definition GeometryCollectionRendering.h:170
virtual ENGINE_API void ReleaseRHI() override
Definition GeometryCollectionRendering.cpp:293
virtual ENGINE_API void InitRHI(FRHICommandListBase &RHICmdList) override
Definition GeometryCollectionRendering.cpp:130
void SetData(FRHICommandListBase &RHICmdList, const FDataType &InData)
Definition GeometryCollectionRendering.h:94
void SetBonePrevTransformSRV(FRHIShaderResourceView *BonePrevTransformSRV)
Definition GeometryCollectionRendering.h:175
FRHIShaderResourceView * GetPositionsSRV() const
Definition GeometryCollectionRendering.h:120
void Copy(const FGeometryCollectionVertexFactory &Other)
Definition GeometryCollectionRendering.h:104
FGeometryCollectionVertexFactory(ERHIFeatureLevel::Type InFeatureLevel, bool EnableLooseParameter=false)
Definition GeometryCollectionRendering.h:61
Definition MeshBatch.h:232
Definition ShaderCore.h:544
Definition Components.h:38
int8 LightMapCoordinateIndex
Definition Components.h:65
uint32 ColorIndexMask
Definition Components.h:64
FRHIShaderResourceView * TextureCoordinatesSRV
Definition Components.h:59
uint8 NumTexCoords
Definition Components.h:66
FRHIShaderResourceView * TangentsSRV
Definition Components.h:56
FRHIShaderResourceView * PositionComponentSRV
Definition Components.h:54
FRHIShaderResourceView * ColorComponentsSRV
Definition Components.h:62
Definition MeshMaterialShader.h:44