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

Classes

class  FVelocityVS
 
class  TVelocityVS< PassMode >
 
class  FVelocityPS
 
class  TVelocityPS< PassMode >
 
class  FMotionVectorWorldOffsetVelocityResolveCS
 

Enumerations

enum  EVelocityPassMode { Velocity_Standard , Velocity_ClippedDepth , Velocity_StereoMotionVectors }
 

Functions

 DECLARE_GPU_DRAWCALL_STAT_NAMED (RenderVelocities, TEXT("Render Velocities"))
 
void ValidateVelocityCVars ()
 
bool NeedVelocityDepth (EShaderPlatform ShaderPlatform)
 
bool SupportsTemporalResponsiveness (EShaderPlatform ShaderPlatform)
 
bool SupportsPixelShaderMotionVectorWorldOffset (EShaderPlatform ShaderPlatform)
 
bool SupportsTranslucentClippedDepth (EShaderPlatform ShaderPlatform)
 
 IMPLEMENT_SHADER_TYPE (, FVelocityVS, TEXT("/Engine/Private/VelocityShader.usf"), TEXT("MainVertexShader"), SF_Vertex)
 
 IMPLEMENT_SHADER_TYPE (, FVelocityPS, TEXT("/Engine/Private/VelocityShader.usf"), TEXT("MainPixelShader"), SF_Pixel)
 
 IMPLEMENT_MATERIAL_SHADER_TYPE (template<>, TVelocityVS< EVelocityPassMode::Velocity_Standard >, TEXT("/Engine/Private/VelocityShader.usf"), TEXT("MainVertexShader"), SF_Vertex)
 
 IMPLEMENT_MATERIAL_SHADER_TYPE (template<>, TVelocityVS< EVelocityPassMode::Velocity_ClippedDepth >, TEXT("/Engine/Private/VelocityShader.usf"), TEXT("MainVertexShader"), SF_Vertex)
 
 IMPLEMENT_MATERIAL_SHADER_TYPE (template<>, TVelocityVS< EVelocityPassMode::Velocity_StereoMotionVectors >, TEXT("/Engine/Private/VelocityShader.usf"), TEXT("MainVertexShader"), SF_Vertex)
 
 IMPLEMENT_MATERIAL_SHADER_TYPE (template<>, TVelocityPS< EVelocityPassMode::Velocity_Standard >, TEXT("/Engine/Private/VelocityShader.usf"), TEXT("MainPixelShader"), SF_Pixel)
 
 IMPLEMENT_MATERIAL_SHADER_TYPE (template<>, TVelocityPS< EVelocityPassMode::Velocity_ClippedDepth >, TEXT("/Engine/Private/VelocityShader.usf"), TEXT("MainPixelShader"), SF_Pixel)
 
 IMPLEMENT_MATERIAL_SHADER_TYPE (template<>, TVelocityPS< EVelocityPassMode::Velocity_StereoMotionVectors >, TEXT("/Engine/Private/VelocityShader.usf"), TEXT("MainPixelShader"), SF_Pixel)
 
 IMPLEMENT_SHADERPIPELINE_TYPE_VSPS (StandardVelocityPipeline, TVelocityVS< EVelocityPassMode::Velocity_Standard >, TVelocityPS< EVelocityPassMode::Velocity_Standard >, true)
 
 IMPLEMENT_SHADERPIPELINE_TYPE_VSPS (VelocityClippedDepthPipeline, TVelocityVS< EVelocityPassMode::Velocity_ClippedDepth >, TVelocityPS< EVelocityPassMode::Velocity_ClippedDepth >, true)
 
 IMPLEMENT_SHADERPIPELINE_TYPE_VSPS (VelocityMotionVectorsPipeline, TVelocityVS< EVelocityPassMode::Velocity_StereoMotionVectors >, TVelocityPS< EVelocityPassMode::Velocity_StereoMotionVectors >, true)
 
 IMPLEMENT_GLOBAL_SHADER (FMotionVectorWorldOffsetVelocityResolveCS, "/Engine/Private/VelocityUpdate.usf", "MainCS", SF_Compute)
 
EMeshPass::Type GetMeshPassFromVelocityPass (EVelocityPass VelocityPass)
 
 IMPLEMENT_STATIC_UNIFORM_BUFFER_SLOT (VelocityClippedDepth)
 
 IMPLEMENT_STATIC_UNIFORM_BUFFER_STRUCT (FVelocityClippedDepthUniformParameters, "VelocityClippedDepth", VelocityClippedDepth)
 
TRDGUniformBufferRef< FVelocityClippedDepthUniformParametersBindTranslucentVelocityClippedDepthPassUniformParameters (FRDGBuilder &GraphBuilder, const FSceneTextures &SceneTextures, bool bWriteVelocity, EShaderPlatform ShaderPlatform)
 
void GetMotionVectorOutputFlag (TArrayView< FViewInfo > InViews, EMeshPass::Type MeshPass, bool bForceVelocity, bool &bUsesAnyMotionVectorWorldOffsetMaterials)
 
bool GetVelocityPassShaders (const FMaterial &Material, const FVertexFactoryType *VertexFactoryType, ERHIFeatureLevel::Type FeatureLevel, EVelocityPassMode PassMode, TShaderRef< FVelocityVS > &VertexShader, TShaderRef< FVelocityPS > &PixelShader)
 
FMeshPassProcessorCreateVelocityPassProcessor (ERHIFeatureLevel::Type FeatureLevel, const FScene *Scene, const FSceneView *InViewIfDynamicMeshCommand, FMeshPassDrawListContext *InDrawListContext)
 
 REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR (VelocityPass, CreateVelocityPassProcessor, EShadingPath::Deferred, EMeshPass::Velocity, EMeshPassFlags::CachedMeshCommands|EMeshPassFlags::MainView)
 
 REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR (MobileVelocityPass, CreateVelocityPassProcessor, EShadingPath::Mobile, EMeshPass::Velocity, EMeshPassFlags::CachedMeshCommands|EMeshPassFlags::MainView)
 
FMeshPassProcessorCreateTranslucentVelocityPassProcessor (ERHIFeatureLevel::Type FeatureLevel, const FScene *Scene, const FSceneView *InViewIfDynamicMeshCommand, FMeshPassDrawListContext *InDrawListContext)
 
FMeshPassProcessorCreateTranslucentVelocityClippedDepthPassProcessor (ERHIFeatureLevel::Type FeatureLevel, const FScene *Scene, const FSceneView *InViewIfDynamicMeshCommand, FMeshPassDrawListContext *InDrawListContext)
 
 REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR (TranslucentVelocityPass, CreateTranslucentVelocityPassProcessor, EShadingPath::Deferred, EMeshPass::TranslucentVelocity, EMeshPassFlags::CachedMeshCommands|EMeshPassFlags::MainView)
 
 REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR (TranslucentVelocityClippedDepthPass, CreateTranslucentVelocityClippedDepthPassProcessor, EShadingPath::Deferred, EMeshPass::TranslucentVelocityClippedDepth, EMeshPassFlags::CachedMeshCommands|EMeshPassFlags::MainView)
 
 REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR (MobileTranslucentVelocityPass, CreateTranslucentVelocityPassProcessor, EShadingPath::Mobile, EMeshPass::TranslucentVelocity, EMeshPassFlags::CachedMeshCommands|EMeshPassFlags::MainView)
 

Enumeration Type Documentation

◆ EVelocityPassMode

Enumerator
Velocity_Standard 
Velocity_ClippedDepth 
Velocity_StereoMotionVectors 

Function Documentation

◆ BindTranslucentVelocityClippedDepthPassUniformParameters()

TRDGUniformBufferRef< FVelocityClippedDepthUniformParameters > BindTranslucentVelocityClippedDepthPassUniformParameters ( FRDGBuilder GraphBuilder,
const FSceneTextures SceneTextures,
bool  bWriteVelocity,
EShaderPlatform  ShaderPlatform 
)

◆ CreateTranslucentVelocityClippedDepthPassProcessor()

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

◆ CreateTranslucentVelocityPassProcessor()

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

◆ CreateVelocityPassProcessor()

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

◆ DECLARE_GPU_DRAWCALL_STAT_NAMED()

DECLARE_GPU_DRAWCALL_STAT_NAMED ( RenderVelocities  ,
TEXT("Render Velocities"  
)

◆ GetMeshPassFromVelocityPass()

EMeshPass::Type GetMeshPassFromVelocityPass ( EVelocityPass  VelocityPass)

◆ GetMotionVectorOutputFlag()

void GetMotionVectorOutputFlag ( TArrayView< FViewInfo InViews,
EMeshPass::Type  MeshPass,
bool  bForceVelocity,
bool bUsesAnyMotionVectorWorldOffsetMaterials 
)

◆ GetVelocityPassShaders()

bool GetVelocityPassShaders ( const FMaterial Material,
const FVertexFactoryType VertexFactoryType,
ERHIFeatureLevel::Type  FeatureLevel,
EVelocityPassMode  PassMode,
TShaderRef< FVelocityVS > &  VertexShader,
TShaderRef< FVelocityPS > &  PixelShader 
)

◆ IMPLEMENT_GLOBAL_SHADER()

IMPLEMENT_GLOBAL_SHADER ( FMotionVectorWorldOffsetVelocityResolveCS  ,
"/Engine/Private/VelocityUpdate.usf"  ,
"MainCS"  ,
SF_Compute   
)

◆ IMPLEMENT_MATERIAL_SHADER_TYPE() [1/6]

IMPLEMENT_MATERIAL_SHADER_TYPE ( template<>  ,
TVelocityPS< EVelocityPassMode::Velocity_ClippedDepth ,
TEXT("/Engine/Private/VelocityShader.usf" ,
TEXT("MainPixelShader")  ,
SF_Pixel   
)

◆ IMPLEMENT_MATERIAL_SHADER_TYPE() [2/6]

IMPLEMENT_MATERIAL_SHADER_TYPE ( template<>  ,
TVelocityPS< EVelocityPassMode::Velocity_Standard ,
TEXT("/Engine/Private/VelocityShader.usf" ,
TEXT("MainPixelShader")  ,
SF_Pixel   
)

◆ IMPLEMENT_MATERIAL_SHADER_TYPE() [3/6]

IMPLEMENT_MATERIAL_SHADER_TYPE ( template<>  ,
TVelocityPS< EVelocityPassMode::Velocity_StereoMotionVectors ,
TEXT("/Engine/Private/VelocityShader.usf" ,
TEXT("MainPixelShader")  ,
SF_Pixel   
)

◆ IMPLEMENT_MATERIAL_SHADER_TYPE() [4/6]

IMPLEMENT_MATERIAL_SHADER_TYPE ( template<>  ,
TVelocityVS< EVelocityPassMode::Velocity_ClippedDepth ,
TEXT("/Engine/Private/VelocityShader.usf" ,
TEXT("MainVertexShader")  ,
SF_Vertex   
)

◆ IMPLEMENT_MATERIAL_SHADER_TYPE() [5/6]

IMPLEMENT_MATERIAL_SHADER_TYPE ( template<>  ,
TVelocityVS< EVelocityPassMode::Velocity_Standard ,
TEXT("/Engine/Private/VelocityShader.usf" ,
TEXT("MainVertexShader")  ,
SF_Vertex   
)

◆ IMPLEMENT_MATERIAL_SHADER_TYPE() [6/6]

IMPLEMENT_MATERIAL_SHADER_TYPE ( template<>  ,
TVelocityVS< EVelocityPassMode::Velocity_StereoMotionVectors ,
TEXT("/Engine/Private/VelocityShader.usf" ,
TEXT("MainVertexShader")  ,
SF_Vertex   
)

◆ IMPLEMENT_SHADER_TYPE() [1/2]

IMPLEMENT_SHADER_TYPE ( FVelocityPS  ,
TEXT("/Engine/Private/VelocityShader.usf" ,
TEXT("MainPixelShader")  ,
SF_Pixel   
)

◆ IMPLEMENT_SHADER_TYPE() [2/2]

IMPLEMENT_SHADER_TYPE ( FVelocityVS  ,
TEXT("/Engine/Private/VelocityShader.usf" ,
TEXT("MainVertexShader")  ,
SF_Vertex   
)

◆ IMPLEMENT_SHADERPIPELINE_TYPE_VSPS() [1/3]

◆ IMPLEMENT_SHADERPIPELINE_TYPE_VSPS() [2/3]

◆ IMPLEMENT_SHADERPIPELINE_TYPE_VSPS() [3/3]

◆ IMPLEMENT_STATIC_UNIFORM_BUFFER_SLOT()

IMPLEMENT_STATIC_UNIFORM_BUFFER_SLOT ( VelocityClippedDepth  )

◆ IMPLEMENT_STATIC_UNIFORM_BUFFER_STRUCT()

IMPLEMENT_STATIC_UNIFORM_BUFFER_STRUCT ( FVelocityClippedDepthUniformParameters  ,
"VelocityClippedDepth"  ,
VelocityClippedDepth   
)

◆ NeedVelocityDepth()

bool NeedVelocityDepth ( EShaderPlatform  ShaderPlatform)

◆ REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR() [1/5]

◆ REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR() [2/5]

◆ REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR() [3/5]

◆ REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR() [4/5]

◆ REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR() [5/5]

◆ SupportsPixelShaderMotionVectorWorldOffset()

bool SupportsPixelShaderMotionVectorWorldOffset ( EShaderPlatform  ShaderPlatform)

◆ SupportsTemporalResponsiveness()

bool SupportsTemporalResponsiveness ( EShaderPlatform  ShaderPlatform)

◆ SupportsTranslucentClippedDepth()

bool SupportsTranslucentClippedDepth ( EShaderPlatform  ShaderPlatform)

◆ ValidateVelocityCVars()

void ValidateVelocityCVars ( )
inline

Validate that deprecated CVars are no longer set.