r.FastVRam.VelocityFlat
r.FastVRam.VelocityFlat
#Overview
name: r.FastVRam.VelocityFlat
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.FastVRam.VelocityFlat is to control the texture creation flags for the velocity flattening process in Unreal Engine’s rendering system. This setting is specifically related to motion blur and temporal effects in the rendering pipeline.
This setting variable is primarily used by the Renderer module of Unreal Engine. Based on the callsites, it’s utilized in the scene rendering process, post-processing for motion blur, and temporal super-resolution.
The value of this variable is set through a console variable (CVar) system, as evidenced by the FASTVRAM_CVAR macro used in the SceneRendering.cpp file. It’s updated in the FFastVramConfig::Update function, where it’s read from the CVarFastVRam_VelocityFlat console variable.
The r.FastVRam.VelocityFlat variable interacts with the VelocityFlat member of the FFastVramConfig struct. This associated variable is used to set texture creation flags when creating textures for velocity flattening in motion blur and temporal super-resolution processes.
Developers should be aware that changing this variable will affect the creation of textures used in velocity-related calculations, potentially impacting performance and memory usage. It’s important to note that this setting is part of a larger system of fast VRAM configuration options, and changes should be considered in the context of overall rendering performance.
Best practices when using this variable include:
- Only modify it if you have a thorough understanding of the rendering pipeline and texture creation process.
- Test any changes extensively, as they can affect both performance and visual quality.
- Consider the target hardware when adjusting this setting, as its impact may vary across different GPU architectures.
Regarding the associated variable VelocityFlat:
The purpose of VelocityFlat is to store the actual texture creation flags used when creating textures for velocity flattening. It’s a member of the FFastVramConfig struct and directly influences how these textures are created and stored in memory.
This variable is used in the Renderer module, specifically in the post-processing stages for motion blur and temporal super-resolution. It’s applied when creating textures with names like “MotionBlur.VelocityFlatten”.
The value of VelocityFlat is set based on the r.FastVRam.VelocityFlat console variable, updated in the FFastVramConfig::Update function.
VelocityFlat interacts with the texture creation process, being combined with other flags like TexCreate_ShaderResource and TexCreate_UAV to determine the final creation flags for velocity-related textures.
Developers should be aware that this variable directly affects how velocity textures are created and stored, which can impact both performance and visual quality of motion-related effects.
Best practices for using VelocityFlat include:
- Ensure it’s set appropriately for the target hardware and performance requirements.
- Monitor its impact on memory usage and rendering performance when modified.
- Consider its interaction with other fast VRAM settings for a holistic approach to rendering optimization.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:477
Scope: file
Source code excerpt:
FASTVRAM_CVAR(Histogram, 1);
FASTVRAM_CVAR(HistogramReduce, 1);
FASTVRAM_CVAR(VelocityFlat, 1);
FASTVRAM_CVAR(VelocityMax, 1);
FASTVRAM_CVAR(MotionBlur, 1);
FASTVRAM_CVAR(Tonemap, 1);
FASTVRAM_CVAR(Upscale, 1);
FASTVRAM_CVAR(DistanceFieldNormal, 1);
FASTVRAM_CVAR(DistanceFieldAOHistory, 1);
#Associated Variable and Callsites
This variable is associated with another variable named VelocityFlat
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessMotionBlur.cpp:624
Scope: file
Source code excerpt:
PF_FloatR11G11B10,
FClearValueBinding::None,
GFastVRamConfig.VelocityFlat | TexCreate_ShaderResource | TexCreate_UAV);
VelocityFlatTexture = GraphBuilder.CreateTexture(Desc, TEXT("MotionBlur.VelocityFlatten"));
}
VelocityTileTextureSetup = CreateVelocityTileTexture(
GraphBuilder, VelocityTileCount, BlurDirections, TEXT("MotionBlur.VelocityTile"));
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalSuperResolution.cpp:1842
Scope (from outer to inner):
file
function FDefaultTemporalUpscaler::FOutputs AddTemporalSuperResolutionPasses
Source code excerpt:
PF_FloatR11G11B10,
FClearValueBinding::None,
GFastVRamConfig.VelocityFlat | TexCreate_ShaderResource | TexCreate_UAV);
VelocityFlattenTextures.VelocityFlatten.Texture = GraphBuilder.CreateTexture(Desc, TEXT("MotionBlur.VelocityFlatten"));
VelocityFlattenTextures.VelocityFlatten.ViewRect = InputRect;
}
{
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:477
Scope: file
Source code excerpt:
FASTVRAM_CVAR(Histogram, 1);
FASTVRAM_CVAR(HistogramReduce, 1);
FASTVRAM_CVAR(VelocityFlat, 1);
FASTVRAM_CVAR(VelocityMax, 1);
FASTVRAM_CVAR(MotionBlur, 1);
FASTVRAM_CVAR(Tonemap, 1);
FASTVRAM_CVAR(Upscale, 1);
FASTVRAM_CVAR(DistanceFieldNormal, 1);
FASTVRAM_CVAR(DistanceFieldAOHistory, 1);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:677
Scope (from outer to inner):
file
function void FFastVramConfig::Update
Source code excerpt:
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_Histogram, Histogram);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_HistogramReduce, HistogramReduce);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_VelocityFlat, VelocityFlat);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_VelocityMax, VelocityMax);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_MotionBlur, MotionBlur);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_Tonemap, Tonemap);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_Upscale, Upscale);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_DistanceFieldNormal, DistanceFieldNormal);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_DistanceFieldAOHistory, DistanceFieldAOHistory);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.h:2826
Scope: file
Source code excerpt:
ETextureCreateFlags Histogram;
ETextureCreateFlags HistogramReduce;
ETextureCreateFlags VelocityFlat;
ETextureCreateFlags VelocityMax;
ETextureCreateFlags MotionBlur;
ETextureCreateFlags Tonemap;
ETextureCreateFlags Upscale;
ETextureCreateFlags DistanceFieldNormal;
ETextureCreateFlags DistanceFieldAOHistory;