r.LUT.UpdateEveryFrame
r.LUT.UpdateEveryFrame
#Overview
name: r.LUT.UpdateEveryFrame
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Controls whether the tonemapping LUT pass is executed every frame.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LUT.UpdateEveryFrame is to control whether the tonemapping LUT (Look-Up Table) pass is executed every frame in the rendering pipeline of Unreal Engine 5.
This setting variable is primarily used in the rendering system, specifically in the post-processing stage of the rendering pipeline. It is part of the Renderer module of Unreal Engine.
The value of this variable is set through the console variable system in Unreal Engine. It is defined as a TAutoConsoleVariable with a default value of 0, meaning that by default, the LUT is not updated every frame.
The associated variable CVarLutUpdateEveryFrame directly interacts with r.LUT.UpdateEveryFrame. They share the same value and purpose.
Developers must be aware that enabling this setting (setting it to 1) will cause the tonemapping LUT pass to be executed every frame, which can have performance implications. It should only be enabled when necessary, such as during development or debugging of tonemapping-related features.
Best practices when using this variable include:
- Keeping it disabled (0) for optimal performance in most scenarios.
- Only enabling it temporarily when actively working on or debugging tonemapping-related features.
- Being mindful of the performance impact when enabled, especially on lower-end hardware.
Regarding the associated variable CVarLUTUpdateEveryFrame:
- It is the actual console variable object that controls the behavior.
- It is used in the AddCombineLUTPass function to determine whether to update the LUT every frame.
- The value is retrieved using GetValueOnRenderThread(), ensuring thread-safe access in the render thread.
- When set to 0, it allows for caching of the LUT, potentially improving performance by avoiding unnecessary updates.
Developers should use this variable through the console command system or project settings, rather than directly manipulating the CVarLUTUpdateEveryFrame object in code, to ensure proper engine integration and thread safety.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessCombineLUTs.cpp:45
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<int32> CVarLUTUpdateEveryFrame(
TEXT("r.LUT.UpdateEveryFrame"), 0,
TEXT("Controls whether the tonemapping LUT pass is executed every frame."),
ECVF_RenderThreadSafe);
// Including the neutral one at index 0
const uint32 GMaxLUTBlendCount = 5;
#Associated Variable and Callsites
This variable is associated with another variable named CVarLUTUpdateEveryFrame
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessCombineLUTs.cpp:44
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarLUTUpdateEveryFrame(
TEXT("r.LUT.UpdateEveryFrame"), 0,
TEXT("Controls whether the tonemapping LUT pass is executed every frame."),
ECVF_RenderThreadSafe);
// Including the neutral one at index 0
const uint32 GMaxLUTBlendCount = 5;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessCombineLUTs.cpp:505
Scope (from outer to inner):
file
function FRDGTextureRef AddCombineLUTPass
Source code excerpt:
const bool bHasChanged = CachedLUTSettings.UpdateCachedValues(View, LocalTextures, LocalWeights, LocalCount);
if (!bHasChanged && OutputTexture && CVarLUTUpdateEveryFrame.GetValueOnRenderThread() == 0)
{
return OutputTexture;
}
// View doesn't support a persistent LUT, so create a temporary one.
if (!OutputTexture)