UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MeshMaterialShader.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 MeshMaterialShader.h: Shader base classes
5=============================================================================*/
6
7#pragma once
8
10#include "MaterialShader.h"
11
13class FSceneView;
14struct FMeshBatch;
18
19template<typename TBufferStruct> class TUniformBufferRef;
20
22{
23public:
26
28 RENDERER_API void InitializeMeshMaterialData(const FSceneView* SceneView, const FPrimitiveSceneProxy* RESTRICT PrimitiveSceneProxy, const FMeshBatch& RESTRICT MeshBatch, int32 StaticMeshId, bool bAllowStencilDither);
29 RENDERER_API void InitializeMeshMaterialData(const FSceneView* SceneView, const FPrimitiveSceneProxy* RESTRICT PrimitiveSceneProxy, int32 StaticMeshId, bool bDitheredLODTransition, bool bAllowStencilDither);
30};
31
42
65
68{
70public:
73
75
77
79 const FScene* Scene,
80 ERHIFeatureLevel::Type FeatureLevel,
81 const FPrimitiveSceneProxy* PrimitiveSceneProxy,
82 const FMaterialRenderProxy& MaterialRenderProxy,
83 const FMaterial& Material,
85 FMeshDrawSingleShaderBindings& ShaderBindings) const;
86
88 const FShaderMapPointerTable& PointerTable,
89 const FScene* Scene,
90 const FSceneView* ViewIfDynamicMeshCommand,
91 const FVertexFactory* VertexFactory,
93 const FStaticFeatureLevel FeatureLevel,
94 const FPrimitiveSceneProxy* PrimitiveSceneProxy,
95 const FMeshBatch& MeshBatch,
98 FMeshDrawSingleShaderBindings& ShaderBindings,
99 FVertexInputStreamArray& VertexStreams) const;
100
101 template<typename ShaderType, typename PointerTableType, typename ShaderElementDataType>
103 const FScene* Scene,
104 const FSceneView* ViewIfDynamicMeshCommand,
105 const FVertexFactory* VertexFactory,
107 ERHIFeatureLevel::Type FeatureLevel,
108 const FPrimitiveSceneProxy* PrimitiveSceneProxy,
109 const FMeshBatch& MeshBatch,
112 FMeshDrawSingleShaderBindings& ShaderBindings,
113 FVertexInputStreamArray& VertexStreams)
114 {
115 Shader->GetElementShaderBindings(Shader.GetPointerTable(), Scene, ViewIfDynamicMeshCommand, VertexFactory, InputStreamType, FeatureLevel, PrimitiveSceneProxy, MeshBatch, BatchElement, ShaderElementData, ShaderBindings, VertexStreams);
116 }
117
118private:
119 RENDERER_API void WriteFrozenVertexFactoryParameters(FMemoryImageWriter& Writer, const TMemoryImagePtr<FVertexFactoryShaderParameters>& InVertexFactoryParameters) const;
121
122protected:
124};
125
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define RESTRICT
Definition Platform.h:706
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_EXPORTED_TYPE_LAYOUT(T, RequiredAPI, Interface)
Definition MemoryLayout.h:559
#define LAYOUT_FIELD_WITH_WRITER(T, Name, Func)
Definition MemoryLayout.h:478
EShaderPlatform
Definition RHIShaderPlatform.h:11
EShaderPermutationFlags
Definition ShaderPermutation.h:19
EVertexInputStreamType
Definition VertexFactory.h:128
Definition MaterialRenderProxy.h:102
Definition MaterialShader.h:56
Definition MaterialShared.h:2058
Definition MemoryImageWriter.h:14
Definition MeshDrawShaderBindings.h:104
Definition MeshMaterialShader.h:22
RENDERER_API void InitializeMeshMaterialData()
Definition ShaderBaseClasses.cpp:19
FRHIUniformBuffer * DitherUniformBuffer
Definition MeshMaterialShader.h:25
FRHIUniformBuffer * FadeUniformBuffer
Definition MeshMaterialShader.h:24
Definition MeshMaterialShaderType.h:26
Definition MeshMaterialShader.h:68
RENDERER_API void GetShaderBindings(const FScene *Scene, ERHIFeatureLevel::Type FeatureLevel, const FPrimitiveSceneProxy *PrimitiveSceneProxy, const FMaterialRenderProxy &MaterialRenderProxy, const FMaterial &Material, const FMeshMaterialShaderElementData &ShaderElementData, FMeshDrawSingleShaderBindings &ShaderBindings) const
Definition ShaderBaseClasses.cpp:457
static void GetElementShaderBindings(const TShaderRefBase< ShaderType, PointerTableType > &Shader, const FScene *Scene, const FSceneView *ViewIfDynamicMeshCommand, const FVertexFactory *VertexFactory, const EVertexInputStreamType InputStreamType, ERHIFeatureLevel::Type FeatureLevel, const FPrimitiveSceneProxy *PrimitiveSceneProxy, const FMeshBatch &MeshBatch, const FMeshBatchElement &BatchElement, const ShaderElementDataType &ShaderElementData, FMeshDrawSingleShaderBindings &ShaderBindings, FVertexInputStreamArray &VertexStreams)
Definition MeshMaterialShader.h:102
LAYOUT_FIELD(FShaderUniformBufferParameter, PassUniformBuffer)
FMeshMaterialShader()
Definition MeshMaterialShader.h:74
RENDERER_API void GetElementShaderBindings(const FShaderMapPointerTable &PointerTable, const FScene *Scene, const FSceneView *ViewIfDynamicMeshCommand, const FVertexFactory *VertexFactory, const EVertexInputStreamType InputStreamType, const FStaticFeatureLevel FeatureLevel, const FPrimitiveSceneProxy *PrimitiveSceneProxy, const FMeshBatch &MeshBatch, const FMeshBatchElement &BatchElement, const FMeshMaterialShaderElementData &ShaderElementData, FMeshDrawSingleShaderBindings &ShaderBindings, FVertexInputStreamArray &VertexStreams) const
Definition ShaderBaseClasses.cpp:471
Definition PrimitiveSceneProxy.h:296
Definition RHIResources.h:1232
Definition SceneView.h:1425
Definition ScenePrivate.h:2875
Definition Shader.h:637
Definition Shader.h:1238
Definition ShaderParameters.h:109
Definition VertexFactory.h:314
Definition VertexFactory.h:661
Definition MemoryImage.h:382
Definition Shader.h:1021
Definition ShaderParameterMacros.h:136
Type
Definition RHIFeatureLevel.h:20
Definition MaterialShared.h:1181
Definition MaterialShader.h:45
Definition MeshBatch.h:232
Definition MeshBatch.h:371
Definition MeshMaterialShader.h:33
FMeshMaterialShaderPermutationParameters(EShaderPlatform InPlatform, const FMaterialShaderParameters &InMaterialParameters, const FVertexFactoryType *InVertexFactoryType, int32 InPermutationId, EShaderPermutationFlags InFlags)
Definition MeshMaterialShader.h:37
const FVertexFactoryType * VertexFactoryType
Definition MeshMaterialShader.h:35
Definition MeshMaterialShaderType.h:29
Definition MeshPassProcessor.h:2118
Definition AndroidStaticFeatureLevel.inl:12
Definition MeshMaterialShader.h:44
const FShaderType * ShaderType
Definition MeshMaterialShader.h:45
EShaderPermutationFlags Flags
Definition MeshMaterialShader.h:49
EShaderPlatform Platform
Definition MeshMaterialShader.h:48
FMaterialShaderParameters MaterialParameters
Definition MeshMaterialShader.h:47
FVertexFactoryShaderPermutationParameters(EShaderPlatform InPlatform, const FMaterialShaderParameters &InMaterialParameters, const FVertexFactoryType *InVertexFactoryType, const FShaderType *InShaderType, EShaderPermutationFlags InFlags)
Definition MeshMaterialShader.h:51
const FVertexFactoryType * VertexFactoryType
Definition MeshMaterialShader.h:46