UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DepthRendering.cpp File Reference

Classes

class  FDitheredTransitionStencilPS
 
class  FDitheredTransitionStencilCS
 

Macros

#define IMPLEMENT_GetDepthPassShaders(bPositionOnly)
 

Functions

bool IsHMDHiddenAreaMaskActive ()
 
FDepthPassInfo GetDepthPassInfo (const FScene *Scene)
 
FDepthPassParametersGetDepthPassParameters (FRDGBuilder &GraphBuilder, const FViewInfo &View, FRDGTextureRef DepthTexture)
 
const TCHARGetDepthDrawingModeString (EDepthDrawingMode Mode)
 
 DECLARE_GPU_DRAWCALL_STAT (Prepass)
 
 IMPLEMENT_MATERIAL_SHADER_TYPE (template<>, TDepthOnlyVS< true >, TEXT("/Engine/Private/PositionOnlyDepthVertexShader.usf"), TEXT("Main"), SF_Vertex)
 
 IMPLEMENT_MATERIAL_SHADER_TYPE (template<>, TDepthOnlyVS< false >, TEXT("/Engine/Private/DepthOnlyVertexShader.usf"), TEXT("Main"), SF_Vertex)
 
 IMPLEMENT_MATERIAL_SHADER_TYPE (, FDepthOnlyPS, TEXT("/Engine/Private/DepthOnlyPixelShader.usf"), TEXT("Main"), SF_Pixel)
 
 IMPLEMENT_SHADERPIPELINE_TYPE_VS (DepthNoPixelPipeline, TDepthOnlyVS< false >, true)
 
 IMPLEMENT_SHADERPIPELINE_TYPE_VS (DepthPosOnlyNoPixelPipeline, TDepthOnlyVS< true >, true)
 
 IMPLEMENT_SHADERPIPELINE_TYPE_VSPS (DepthPipeline, TDepthOnlyVS< false >, FDepthOnlyPS, true)
 
template<bool bPositionOnly>
bool GetDepthPassShaders (const FMaterial &Material, const FVertexFactoryType *VertexFactoryType, ERHIFeatureLevel::Type FeatureLevel, bool bMaterialUsesPixelDepthOffset, TShaderRef< TDepthOnlyVS< bPositionOnly > > &VertexShader, TShaderRef< FDepthOnlyPS > &PixelShader, FShaderPipelineRef &ShaderPipeline)
 
 IMPLEMENT_GetDepthPassShaders (true)
 
 IMPLEMENT_GetDepthPassShaders (false)
 
FDepthStencilStateRHIRef GetDitheredLODTransitionDepthStencilState ()
 
TOptional< uint32GetOptionalDitheringFlag (const FSceneView *SceneView, const FMeshBatch &RESTRICT Mesh, int32 StaticMeshId)
 
 IMPLEMENT_GLOBAL_SHADER (FDitheredTransitionStencilPS, "/Engine/Private/DitheredTransitionStencil.usf", "Main", SF_Pixel)
 
 IMPLEMENT_GLOBAL_SHADER (FDitheredTransitionStencilCS, "/Engine/Private/DitheredTransitionStencil.usf", "MainCS", SF_Compute)
 
void AddDitheredStencilFillPass (FRDGBuilder &GraphBuilder, TConstArrayView< FViewInfo > Views, FRDGTextureRef DepthTexture, const FDepthPassInfo &DepthPass)
 
FDepthStencilStateRHIRef GetDitheredStencilClearPassDepthStencilState (bool bClearAllStencilBits)
 
void AddDitheredStencilClearPass (FRDGBuilder &GraphBuilder, FRDGTextureRef DepthTexture, EShaderPlatform ShaderPlatform, bool bClearAllStencilBits)
 
void SetupDepthPassState (FMeshPassProcessorRenderState &DrawRenderState)
 
const TCHARGetDepthPassReason (bool bDitheredLODTransitionsUseStencil, EShaderPlatform ShaderPlatform)
 (UE_BUILD_SHIPPING || UE_BUILD_TEST)
 
FMeshDrawCommandSortKey CalculateDepthPassMeshStaticSortKey (bool bIsMasked, const FMeshMaterialShader *VertexShader, const FMeshMaterialShader *PixelShader)
 
FMeshPassProcessorCreateDepthPassProcessor (ERHIFeatureLevel::Type FeatureLevel, const FScene *Scene, const FSceneView *InViewIfDynamicMeshCommand, FMeshPassDrawListContext *InDrawListContext)
 
 REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR (DepthPass, CreateDepthPassProcessor, EShadingPath::Deferred, EMeshPass::DepthPass, EMeshPassFlags::CachedMeshCommands|EMeshPassFlags::MainView)
 
 REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR (MobileDepthPass, CreateDepthPassProcessor, EShadingPath::Mobile, EMeshPass::DepthPass, EMeshPassFlags::CachedMeshCommands|EMeshPassFlags::MainView)
 
FMeshPassProcessorCreateSecondStageDepthPassProcessor (ERHIFeatureLevel::Type FeatureLevel, const FScene *Scene, const FSceneView *InViewIfDynamicMeshCommand, FMeshPassDrawListContext *InDrawListContext)
 
 REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR (SecondStageDepthPass, CreateSecondStageDepthPassProcessor, EShadingPath::Deferred, EMeshPass::SecondStageDepthPass, EMeshPassFlags::CachedMeshCommands|EMeshPassFlags::MainView)
 
FMeshPassProcessorCreateDitheredLODFadingOutMaskPassProcessor (ERHIFeatureLevel::Type FeatureLevel, const FScene *Scene, const FSceneView *InViewIfDynamicMeshCommand, FMeshPassDrawListContext *InDrawListContext)
 
 REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR (DitheredLODFadingOutMaskPass, CreateDitheredLODFadingOutMaskPassProcessor, EShadingPath::Deferred, EMeshPass::DitheredLODFadingOutMaskPass, EMeshPassFlags::MainView)
 

Macro Definition Documentation

◆ IMPLEMENT_GetDepthPassShaders

#define IMPLEMENT_GetDepthPassShaders (   bPositionOnly)
Value:
const FMaterial& Material, \
const FVertexFactoryType* VertexFactoryType, \
ERHIFeatureLevel::Type FeatureLevel, \
FShaderPipelineRef& ShaderPipeline \
);
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition MaterialShared.h:2058
Definition Shader.h:2273
Definition VertexFactory.h:314
Definition DepthRendering.h:68
Definition Shader.h:1021
Type
Definition RHIFeatureLevel.h:20

Function Documentation

◆ AddDitheredStencilClearPass()

void AddDitheredStencilClearPass ( FRDGBuilder GraphBuilder,
FRDGTextureRef  DepthTexture,
EShaderPlatform  ShaderPlatform,
bool  bClearAllStencilBits 
)

◆ AddDitheredStencilFillPass()

void AddDitheredStencilFillPass ( FRDGBuilder GraphBuilder,
TConstArrayView< FViewInfo Views,
FRDGTextureRef  DepthTexture,
const FDepthPassInfo DepthPass 
)

◆ CalculateDepthPassMeshStaticSortKey()

FMeshDrawCommandSortKey CalculateDepthPassMeshStaticSortKey ( bool  bIsMasked,
const FMeshMaterialShader VertexShader,
const FMeshMaterialShader PixelShader 
)

◆ CreateDepthPassProcessor()

FMeshPassProcessor * CreateDepthPassProcessor ( ERHIFeatureLevel::Type  FeatureLevel,
const FScene Scene,
const FSceneView InViewIfDynamicMeshCommand,
FMeshPassDrawListContext InDrawListContext 
)

◆ CreateDitheredLODFadingOutMaskPassProcessor()

FMeshPassProcessor * CreateDitheredLODFadingOutMaskPassProcessor ( ERHIFeatureLevel::Type  FeatureLevel,
const FScene Scene,
const FSceneView InViewIfDynamicMeshCommand,
FMeshPassDrawListContext InDrawListContext 
)

◆ CreateSecondStageDepthPassProcessor()

FMeshPassProcessor * CreateSecondStageDepthPassProcessor ( ERHIFeatureLevel::Type  FeatureLevel,
const FScene Scene,
const FSceneView InViewIfDynamicMeshCommand,
FMeshPassDrawListContext InDrawListContext 
)

◆ DECLARE_GPU_DRAWCALL_STAT()

DECLARE_GPU_DRAWCALL_STAT ( Prepass  )

◆ GetDepthDrawingModeString()

const TCHAR * GetDepthDrawingModeString ( EDepthDrawingMode  Mode)

◆ GetDepthPassInfo()

FDepthPassInfo GetDepthPassInfo ( const FScene Scene)

◆ GetDepthPassParameters()

FDepthPassParameters * GetDepthPassParameters ( FRDGBuilder GraphBuilder,
const FViewInfo View,
FRDGTextureRef  DepthTexture 
)

◆ GetDepthPassReason()

const TCHAR * GetDepthPassReason ( bool  bDitheredLODTransitionsUseStencil,
EShaderPlatform  ShaderPlatform 
)
extern

(UE_BUILD_SHIPPING || UE_BUILD_TEST)

◆ GetDepthPassShaders()

template<bool bPositionOnly>
bool GetDepthPassShaders ( const FMaterial Material,
const FVertexFactoryType VertexFactoryType,
ERHIFeatureLevel::Type  FeatureLevel,
bool  bMaterialUsesPixelDepthOffset,
TShaderRef< TDepthOnlyVS< bPositionOnly > > &  VertexShader,
TShaderRef< FDepthOnlyPS > &  PixelShader,
FShaderPipelineRef ShaderPipeline 
)

◆ GetDitheredLODTransitionDepthStencilState()

FDepthStencilStateRHIRef GetDitheredLODTransitionDepthStencilState ( )

◆ GetDitheredStencilClearPassDepthStencilState()

FDepthStencilStateRHIRef GetDitheredStencilClearPassDepthStencilState ( bool  bClearAllStencilBits)

◆ GetOptionalDitheringFlag()

TOptional< uint32 > GetOptionalDitheringFlag ( const FSceneView SceneView,
const FMeshBatch &RESTRICT  Mesh,
int32  StaticMeshId 
)

◆ IMPLEMENT_GetDepthPassShaders() [1/2]

IMPLEMENT_GetDepthPassShaders ( false  )

◆ IMPLEMENT_GetDepthPassShaders() [2/2]

IMPLEMENT_GetDepthPassShaders ( true  )

◆ IMPLEMENT_GLOBAL_SHADER() [1/2]

IMPLEMENT_GLOBAL_SHADER ( FDitheredTransitionStencilCS  ,
"/Engine/Private/DitheredTransitionStencil.usf"  ,
"MainCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [2/2]

IMPLEMENT_GLOBAL_SHADER ( FDitheredTransitionStencilPS  ,
"/Engine/Private/DitheredTransitionStencil.usf"  ,
"Main"  ,
SF_Pixel   
)

◆ IMPLEMENT_MATERIAL_SHADER_TYPE() [1/3]

IMPLEMENT_MATERIAL_SHADER_TYPE ( FDepthOnlyPS  ,
TEXT("/Engine/Private/DepthOnlyPixelShader.usf" ,
TEXT("Main")  ,
SF_Pixel   
)

◆ IMPLEMENT_MATERIAL_SHADER_TYPE() [2/3]

IMPLEMENT_MATERIAL_SHADER_TYPE ( template<>  ,
TDepthOnlyVS< false ,
TEXT("/Engine/Private/DepthOnlyVertexShader.usf" ,
TEXT("Main")  ,
SF_Vertex   
)

◆ IMPLEMENT_MATERIAL_SHADER_TYPE() [3/3]

IMPLEMENT_MATERIAL_SHADER_TYPE ( template<>  ,
TDepthOnlyVS< true ,
TEXT("/Engine/Private/PositionOnlyDepthVertexShader.usf" ,
TEXT("Main")  ,
SF_Vertex   
)

◆ IMPLEMENT_SHADERPIPELINE_TYPE_VS() [1/2]

IMPLEMENT_SHADERPIPELINE_TYPE_VS ( DepthNoPixelPipeline  ,
TDepthOnlyVS< false ,
true   
)

◆ IMPLEMENT_SHADERPIPELINE_TYPE_VS() [2/2]

IMPLEMENT_SHADERPIPELINE_TYPE_VS ( DepthPosOnlyNoPixelPipeline  ,
TDepthOnlyVS< true ,
true   
)

◆ IMPLEMENT_SHADERPIPELINE_TYPE_VSPS()

IMPLEMENT_SHADERPIPELINE_TYPE_VSPS ( DepthPipeline  ,
TDepthOnlyVS< false ,
FDepthOnlyPS  ,
true   
)

◆ IsHMDHiddenAreaMaskActive()

bool IsHMDHiddenAreaMaskActive ( )
extern

◆ REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR() [1/4]

REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR ( DepthPass  ,
CreateDepthPassProcessor  ,
EShadingPath::Deferred  ,
EMeshPass::DepthPass  ,
EMeshPassFlags::CachedMeshCommands|EMeshPassFlags::MainView   
)

◆ REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR() [2/4]

REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR ( DitheredLODFadingOutMaskPass  ,
CreateDitheredLODFadingOutMaskPassProcessor  ,
EShadingPath::Deferred  ,
EMeshPass::DitheredLODFadingOutMaskPass  ,
EMeshPassFlags::MainView   
)

◆ REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR() [3/4]

◆ REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR() [4/4]

◆ SetupDepthPassState()

void SetupDepthPassState ( FMeshPassProcessorRenderState DrawRenderState)