r.FastVRam.SeparateTranslucencyModulate
r.FastVRam.SeparateTranslucencyModulate
#Overview
name: r.FastVRam.SeparateTranslucencyModulate
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.SeparateTranslucencyModulate is to control the texture creation flags for the separate translucency modulate buffer in Unreal Engine 5’s rendering system. This setting is specifically related to the management of fast VRAM usage for translucent rendering.
-
The Unreal Engine subsystem that relies on this setting variable is primarily the Renderer module, as evidenced by the file locations (SceneRendering.cpp, SceneRendering.h, and TranslucentRendering.cpp) where it’s referenced.
-
The value of this variable is set using the FASTVRAM_CVAR macro, which likely defines a console variable (CVar) for runtime configuration. It’s initialized with a value of 0 in the provided code.
-
This variable interacts closely with other fast VRAM configuration settings, particularly those related to translucency rendering. It’s part of a larger FFastVramConfig structure that includes settings for various rendering features.
-
Developers should be aware that this variable affects the texture creation flags for the separate translucency modulate buffer. Changing this value may impact rendering performance and memory usage, especially on platforms with limited or specialized VRAM.
-
Best practices when using this variable include:
- Carefully considering the performance implications before modifying its value.
- Testing any changes across multiple hardware configurations to ensure consistent behavior.
- Coordinating changes with other related fast VRAM settings for optimal results.
Regarding the associated variable SeparateTranslucencyModulate:
The purpose of SeparateTranslucencyModulate is to store the actual texture creation flags for the separate translucency modulate buffer, as determined by the r.FastVRam.SeparateTranslucencyModulate setting.
-
This variable is used directly in the rendering code, particularly in the CreatePostDOFTranslucentTexture and RenderTranslucency functions within the TranslucentRendering.cpp file.
-
Its value is updated in the FFastVramConfig::Update function, based on the corresponding CVar (r.FastVRam.SeparateTranslucencyModulate).
-
It interacts closely with other FastVramConfig variables, especially SeparateTranslucency, as seen in the CreatePostDOFTranslucentTexture function where a conditional check determines which flag to use.
-
Developers should be aware that this variable directly affects the creation of textures used in translucent rendering, potentially impacting both visual quality and performance.
-
Best practices include:
- Ensuring that changes to r.FastVRam.SeparateTranslucencyModulate are reflected in SeparateTranslucencyModulate as expected.
- Considering the implications on both memory usage and rendering performance when modifying this value.
- Testing any changes thoroughly, especially in scenes with complex translucent effects.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:492
Scope: file
Source code excerpt:
FASTVRAM_CVAR(VolumetricFog, 1);
FASTVRAM_CVAR(SeparateTranslucency, 0);
FASTVRAM_CVAR(SeparateTranslucencyModulate, 0);
FASTVRAM_CVAR(ScreenSpaceAO,0);
FASTVRAM_CVAR(SSR, 0);
FASTVRAM_CVAR(DBufferA, 0);
FASTVRAM_CVAR(DBufferB, 0);
FASTVRAM_CVAR(DBufferC, 0);
FASTVRAM_CVAR(DBufferMask, 0);
#Associated Variable and Callsites
This variable is associated with another variable named SeparateTranslucencyModulate
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:492
Scope: file
Source code excerpt:
FASTVRAM_CVAR(VolumetricFog, 1);
FASTVRAM_CVAR(SeparateTranslucency, 0);
FASTVRAM_CVAR(SeparateTranslucencyModulate, 0);
FASTVRAM_CVAR(ScreenSpaceAO,0);
FASTVRAM_CVAR(SSR, 0);
FASTVRAM_CVAR(DBufferA, 0);
FASTVRAM_CVAR(DBufferB, 0);
FASTVRAM_CVAR(DBufferC, 0);
FASTVRAM_CVAR(DBufferMask, 0);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:692
Scope (from outer to inner):
file
function void FFastVramConfig::Update
Source code excerpt:
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_VolumetricFog, VolumetricFog);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_SeparateTranslucency, SeparateTranslucency);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_SeparateTranslucencyModulate, SeparateTranslucencyModulate);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_ScreenSpaceAO, ScreenSpaceAO);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_SSR, SSR);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_DBufferA, DBufferA);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_DBufferB, DBufferB);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_DBufferC, DBufferC);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_DBufferMask, DBufferMask);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.h:2842
Scope: file
Source code excerpt:
ETextureCreateFlags VolumetricFog;
ETextureCreateFlags SeparateTranslucency;
ETextureCreateFlags SeparateTranslucencyModulate;
ETextureCreateFlags ScreenSpaceAO;
ETextureCreateFlags SSR;
ETextureCreateFlags DBufferA;
ETextureCreateFlags DBufferB;
ETextureCreateFlags DBufferC;
ETextureCreateFlags DBufferMask;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/TranslucentRendering.cpp:768
Scope (from outer to inner):
file
function FRDGTextureMSAA CreatePostDOFTranslucentTexture
Source code excerpt:
kTranslucencyColorTextureMultisampledName[int32(TranslucencyPass)],
kTranslucencyColorTextureName[int32(TranslucencyPass)],
bIsModulate ? GFastVRamConfig.SeparateTranslucencyModulate : GFastVRamConfig.SeparateTranslucency);
}
void SetupDownsampledTranslucencyViewParameters(
const FViewInfo& View,
FIntPoint TextureExtent,
FIntRect ViewRect,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/TranslucentRendering.cpp:1547
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::RenderTranslucency
Source code excerpt:
TEXT("Translucency.DepthMS"),
TEXT("Translucency.Depth"),
GFastVRamConfig.SeparateTranslucencyModulate); // TODO: this should be SeparateTranslucency, but is what the code was doing
// Downscale the depth buffer for each individual view, but shared accross all translucencies.
for (int32 ViewIndex = 0; ViewIndex < Views.Num(); ++ViewIndex)
{
FViewInfo& View = Views[ViewIndex];
const ETranslucencyView TranslucencyView = GetTranslucencyView(View);