r.FastVRam.HistogramReduce
r.FastVRam.HistogramReduce
#Overview
name: r.FastVRam.HistogramReduce
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.FastVRam.HistogramReduce is to control the texture creation flags for the histogram reduction texture in Unreal Engine’s rendering system. This setting is specifically related to the post-processing pipeline, particularly the histogram and eye adaptation features.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the post-processing components dealing with histogram generation and reduction.
The value of this variable is set through the FASTVRAM_CVAR macro, which likely creates a console variable (CVar) that can be adjusted at runtime or through configuration files.
This variable interacts closely with the associated variable HistogramReduce, which is a member of the FFastVramConfig struct. The r.FastVRam.HistogramReduce CVar is used to update the HistogramReduce member of this struct.
Developers must be aware that changing this variable affects the texture creation flags for the histogram reduction texture. This can impact performance and memory usage, especially on platforms with different memory architectures or constraints.
Best practices when using this variable include:
- Understanding the target hardware’s memory architecture and constraints.
- Balancing performance and memory usage based on the specific needs of the project.
- Testing thoroughly on target platforms after making changes to ensure no negative impacts on performance or visual quality.
Regarding the associated variable HistogramReduce:
The purpose of HistogramReduce is to store the texture creation flags for the histogram reduction texture within the FFastVramConfig struct.
This variable is used in the renderer module, specifically in the histogram reduction pass of the post-processing pipeline.
The value of HistogramReduce is set in the FFastVramConfig::Update function, which reads the value from the r.FastVRam.HistogramReduce CVar.
HistogramReduce interacts with the r.FastVRam.HistogramReduce CVar and is used when creating the histogram reduction texture in the AddHistogramLegacyPass function.
Developers should be aware that this variable directly affects the creation of the histogram reduction texture and could impact performance and memory usage.
Best practices for using HistogramReduce include:
- Ensuring it’s properly initialized and updated based on the corresponding CVar.
- Considering its impact when optimizing rendering performance, especially on memory-constrained platforms.
- Monitoring its usage in relation to other FastVRam settings to maintain a balanced approach to texture creation across the rendering pipeline.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:476
Scope: file
Source code excerpt:
FASTVRAM_CVAR(EyeAdaptation, 1);
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);
#Associated Variable and Callsites
This variable is associated with another variable named HistogramReduce
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessHistogram.cpp:304
Scope (from outer to inner):
file
function static FRDGTextureRef AddHistogramLegacyPass
Source code excerpt:
FHistogramReducePS::OutputFormat,
FClearValueBinding::None,
GFastVRamConfig.HistogramReduce | TexCreate_RenderTargetable | TexCreate_ShaderResource);
HistogramReduceTexture = GraphBuilder.CreateTexture(TextureDesc, TEXT("HistogramReduce"));
const FScreenPassTextureViewport InputViewport(HistogramTexture);
const FScreenPassTextureViewport OutputViewport(HistogramReduceTexture);
FHistogramReducePS::FParameters* PassParameters = GraphBuilder.AllocParameters<FHistogramReducePS::FParameters>();
PassParameters->Input = GetScreenPassTextureViewportParameters(InputViewport);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:476
Scope: file
Source code excerpt:
FASTVRAM_CVAR(EyeAdaptation, 1);
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);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:676
Scope (from outer to inner):
file
function void FFastVramConfig::Update
Source code excerpt:
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_EyeAdaptation, EyeAdaptation);
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);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.h:2825
Scope: file
Source code excerpt:
ETextureCreateFlags EyeAdaptation;
ETextureCreateFlags Histogram;
ETextureCreateFlags HistogramReduce;
ETextureCreateFlags VelocityFlat;
ETextureCreateFlags VelocityMax;
ETextureCreateFlags MotionBlur;
ETextureCreateFlags Tonemap;
ETextureCreateFlags Upscale;
ETextureCreateFlags DistanceFieldNormal;