r.FastVRam.CombineLUTs
r.FastVRam.CombineLUTs
#Overview
name: r.FastVRam.CombineLUTs
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.CombineLUTs is to control the texture creation flags for the Combined Look-Up Tables (LUTs) used in the rendering pipeline, specifically for post-processing effects related to color grading and tonemapping.
This setting variable is primarily used in the Renderer module of Unreal Engine 5. It affects the creation and management of render targets used for color grading LUTs.
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. It’s initialized with a default value of 1, indicating that by default, the FastVRam optimization is enabled for Combined LUTs.
The r.FastVRam.CombineLUTs variable interacts closely with its associated variable CombineLUTs. They share the same value, and CombineLUTs is used directly in the engine code to set texture flags.
Developers should be aware that:
- This variable affects memory allocation and potentially rendering performance for color grading LUTs.
- Changing this value may impact the memory usage and performance of post-processing effects that rely on these LUTs.
- The effect of this variable depends on the hardware capabilities and may not have an impact on all platforms.
Best practices when using this variable include:
- Only modify if you’re experiencing specific performance issues related to LUT rendering or memory usage.
- Test thoroughly on target hardware after making changes, as the impact may vary across different GPU architectures.
- Consider the trade-off between potential performance gains and memory usage when adjusting this setting.
Regarding the associated variable CombineLUTs:
The purpose of CombineLUTs is to directly apply the FastVRam configuration to the render target used for combined Look-Up Tables in the tonemapping process.
It’s used within the FSceneViewState class to set flags on the render target descriptor for the combined LUTs. This affects how the render target is allocated and potentially how it’s accessed during rendering.
The value of CombineLUTs is updated in the FFastVramConfig::Update() function, which synchronizes it with the r.FastVRam.CombineLUTs console variable.
Developers should be aware that:
- This variable directly affects the creation of the LUT render target used in tonemapping.
- Changes to this variable will impact memory allocation for the LUT texture.
Best practices include:
- Treat this as an internal engine variable and avoid modifying it directly in code.
- If you need to adjust LUT-related performance, use the r.FastVRam.CombineLUTs console variable instead.
- Be cautious when modifying render target creation flags, as it can have subtle effects on rendering quality and performance.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:472
Scope: file
Source code excerpt:
FASTVRAM_CVAR(BokehDOF, 1);
FASTVRAM_CVAR(CircleDOF, 1);
FASTVRAM_CVAR(CombineLUTs, 1);
FASTVRAM_CVAR(Downsample, 1);
FASTVRAM_CVAR(EyeAdaptation, 1);
FASTVRAM_CVAR(Histogram, 1);
FASTVRAM_CVAR(HistogramReduce, 1);
FASTVRAM_CVAR(VelocityFlat, 1);
FASTVRAM_CVAR(VelocityMax, 1);
#Associated Variable and Callsites
This variable is associated with another variable named CombineLUTs
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScenePrivate.h:1391
Scope (from outer to inner):
file
class class FSceneViewState : public FSceneViewStateInterface, public FRenderResource
function static FPooledRenderTargetDesc CreateLUTRenderTarget
Source code excerpt:
}
Desc.DebugName = TEXT("CombineLUTs");
Desc.Flags |= GFastVRamConfig.CombineLUTs;
return Desc;
}
// Returns a reference to the render target used for the LUT. Allocated on the first request.
IPooledRenderTarget* GetTonemappingLUT(FRHICommandList& RHICmdList, const int32 LUTSize, const bool bUseVolumeLUT, const bool bNeedUAV, const bool bNeedFloatOutput)
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:472
Scope: file
Source code excerpt:
FASTVRAM_CVAR(BokehDOF, 1);
FASTVRAM_CVAR(CircleDOF, 1);
FASTVRAM_CVAR(CombineLUTs, 1);
FASTVRAM_CVAR(Downsample, 1);
FASTVRAM_CVAR(EyeAdaptation, 1);
FASTVRAM_CVAR(Histogram, 1);
FASTVRAM_CVAR(HistogramReduce, 1);
FASTVRAM_CVAR(VelocityFlat, 1);
FASTVRAM_CVAR(VelocityMax, 1);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:672
Scope (from outer to inner):
file
function void FFastVramConfig::Update
Source code excerpt:
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_BokehDOF, BokehDOF);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_CircleDOF, CircleDOF);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_CombineLUTs, CombineLUTs);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_Downsample, Downsample);
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);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.h:2821
Scope: file
Source code excerpt:
ETextureCreateFlags BokehDOF;
ETextureCreateFlags CircleDOF;
ETextureCreateFlags CombineLUTs;
ETextureCreateFlags Downsample;
ETextureCreateFlags EyeAdaptation;
ETextureCreateFlags Histogram;
ETextureCreateFlags HistogramReduce;
ETextureCreateFlags VelocityFlat;
ETextureCreateFlags VelocityMax;