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

Classes

class  FDistortionScreenPS
 
class  FDistortionApplyScreenPS
 
class  FDistortionMergeScreenPS
 
class  FDistortionMeshVS
 
class  FDistortionMeshPS
 
class  FCopySceneColorTexturePS
 
class  FDownsampleSceneColorCS
 
class  FGaussianFiltering
 
class  FFilterSceneColorCS
 

Macros

#define MAX_FILTER_SAMPLE_COUNT_RADIUS   32
 
#define MAX_FILTER_SAMPLE_COUNT   (MAX_FILTER_SAMPLE_COUNT_RADIUS*2+1)
 

Functions

 DECLARE_GPU_DRAWCALL_STAT (Distortion)
 
 IMPLEMENT_STATIC_UNIFORM_BUFFER_STRUCT (FDistortionPassUniformParameters, "DistortionPass", SceneTextures)
 
uint32 GetRefractionOffsetQuality (EShaderPlatform InPlatform)
 
void SetupDistortionParams (FVector4f &DistortionParams, const FViewInfo &View)
 
TRDGUniformBufferRef< FDistortionPassUniformParametersCreateDistortionPassUniformBuffer (FRDGBuilder &GraphBuilder, const FViewInfo &View)
 
bool GetSubstrateEnabledUseRoughRefraction ()
 
 IMPLEMENT_GLOBAL_SHADER (FDistortionApplyScreenPS, "/Engine/Private/DistortApplyScreenPS.usf", "Main", SF_Pixel)
 
 IMPLEMENT_GLOBAL_SHADER (FDistortionMergeScreenPS, "/Engine/Private/DistortApplyScreenPS.usf", "Merge", SF_Pixel)
 
 IMPLEMENT_MATERIAL_SHADER_TYPE (, FDistortionMeshVS, TEXT("/Engine/Private/DistortAccumulateVS.usf"), TEXT("Main"), SF_Vertex)
 
 IMPLEMENT_MATERIAL_SHADER_TYPE (, FDistortionMeshPS, TEXT("/Engine/Private/DistortAccumulatePS.usf"), TEXT("Main"), SF_Pixel)
 
 IMPLEMENT_GLOBAL_SHADER (FCopySceneColorTexturePS, "/Engine/Private/DistortFiltering.usf", "CopySceneColorDepthTexturePS", SF_Pixel)
 
 IMPLEMENT_GLOBAL_SHADER (FDownsampleSceneColorCS, "/Engine/Private/DistortFiltering.usf", "DownsampleColorCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FFilterSceneColorCS, "/Engine/Private/DistortFiltering.usf", "FilterColorCS", SF_Compute)
 
bool GetDistortionPassShaders (const FMaterial &Material, const FVertexFactoryType *VertexFactoryType, ERHIFeatureLevel::Type FeatureLevel, TShaderRef< FDistortionMeshVS > &VertexShader, TShaderRef< FDistortionMeshPS > &PixelShader)
 
FMeshPassProcessorCreateDistortionPassProcessor (ERHIFeatureLevel::Type FeatureLevel, const FScene *Scene, const FSceneView *InViewIfDynamicMeshCommand, FMeshPassDrawListContext *InDrawListContext)
 
FMeshPassProcessorCreateMobileDistortionPassProcessor (ERHIFeatureLevel::Type FeatureLevel, const FScene *Scene, const FSceneView *InViewIfDynamicMeshCommand, FMeshPassDrawListContext *InDrawListContext)
 
 REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR (DistortionPass, CreateDistortionPassProcessor, EShadingPath::Deferred, EMeshPass::Distortion, EMeshPassFlags::MainView)
 
 REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR (MobileDistortionPass, CreateMobileDistortionPassProcessor, EShadingPath::Mobile, EMeshPass::Distortion, EMeshPassFlags::MainView)
 

Macro Definition Documentation

◆ MAX_FILTER_SAMPLE_COUNT

#define MAX_FILTER_SAMPLE_COUNT   (MAX_FILTER_SAMPLE_COUNT_RADIUS*2+1)

◆ MAX_FILTER_SAMPLE_COUNT_RADIUS

#define MAX_FILTER_SAMPLE_COUNT_RADIUS   32

Function Documentation

◆ CreateDistortionPassProcessor()

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

◆ CreateDistortionPassUniformBuffer()

TRDGUniformBufferRef< FDistortionPassUniformParameters > CreateDistortionPassUniformBuffer ( FRDGBuilder GraphBuilder,
const FViewInfo View 
)

◆ CreateMobileDistortionPassProcessor()

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

◆ DECLARE_GPU_DRAWCALL_STAT()

DECLARE_GPU_DRAWCALL_STAT ( Distortion  )

◆ GetDistortionPassShaders()

bool GetDistortionPassShaders ( const FMaterial Material,
const FVertexFactoryType VertexFactoryType,
ERHIFeatureLevel::Type  FeatureLevel,
TShaderRef< FDistortionMeshVS > &  VertexShader,
TShaderRef< FDistortionMeshPS > &  PixelShader 
)

◆ GetRefractionOffsetQuality()

uint32 GetRefractionOffsetQuality ( EShaderPlatform  InPlatform)

◆ GetSubstrateEnabledUseRoughRefraction()

bool GetSubstrateEnabledUseRoughRefraction ( )

◆ IMPLEMENT_GLOBAL_SHADER() [1/5]

IMPLEMENT_GLOBAL_SHADER ( FCopySceneColorTexturePS  ,
"/Engine/Private/DistortFiltering.usf"  ,
"CopySceneColorDepthTexturePS"  ,
SF_Pixel   
)

◆ IMPLEMENT_GLOBAL_SHADER() [2/5]

IMPLEMENT_GLOBAL_SHADER ( FDistortionApplyScreenPS  ,
"/Engine/Private/DistortApplyScreenPS.usf"  ,
"Main"  ,
SF_Pixel   
)

◆ IMPLEMENT_GLOBAL_SHADER() [3/5]

IMPLEMENT_GLOBAL_SHADER ( FDistortionMergeScreenPS  ,
"/Engine/Private/DistortApplyScreenPS.usf"  ,
"Merge"  ,
SF_Pixel   
)

◆ IMPLEMENT_GLOBAL_SHADER() [4/5]

IMPLEMENT_GLOBAL_SHADER ( FDownsampleSceneColorCS  ,
"/Engine/Private/DistortFiltering.usf"  ,
"DownsampleColorCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [5/5]

IMPLEMENT_GLOBAL_SHADER ( FFilterSceneColorCS  ,
"/Engine/Private/DistortFiltering.usf"  ,
"FilterColorCS"  ,
SF_Compute   
)

◆ IMPLEMENT_MATERIAL_SHADER_TYPE() [1/2]

IMPLEMENT_MATERIAL_SHADER_TYPE ( FDistortionMeshPS  ,
TEXT("/Engine/Private/DistortAccumulatePS.usf" ,
TEXT("Main")  ,
SF_Pixel   
)

◆ IMPLEMENT_MATERIAL_SHADER_TYPE() [2/2]

IMPLEMENT_MATERIAL_SHADER_TYPE ( FDistortionMeshVS  ,
TEXT("/Engine/Private/DistortAccumulateVS.usf" ,
TEXT("Main")  ,
SF_Vertex   
)

◆ IMPLEMENT_STATIC_UNIFORM_BUFFER_STRUCT()

IMPLEMENT_STATIC_UNIFORM_BUFFER_STRUCT ( FDistortionPassUniformParameters  ,
"DistortionPass"  ,
SceneTextures   
)

◆ REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR() [1/2]

REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR ( DistortionPass  ,
CreateDistortionPassProcessor  ,
EShadingPath::Deferred  ,
EMeshPass::Distortion  ,
EMeshPassFlags::MainView   
)

◆ REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR() [2/2]

◆ SetupDistortionParams()

void SetupDistortionParams ( FVector4f DistortionParams,
const FViewInfo View 
)