r.ManyLights.Reset
r.ManyLights.Reset
#Overview
name: r.ManyLights.Reset
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Reset history for debugging.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.ManyLights.Reset is to reset the history for debugging in the Many Lights rendering system of Unreal Engine 5. This setting variable is primarily used for the rendering system, specifically the deferred shading and lighting components.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the Many Lights system within the deferred shading scene renderer.
The value of this variable is set through the console variable system, as indicated by the FAutoConsoleVariableRef declaration. It can be modified at runtime using console commands or through configuration files.
This variable interacts directly with its associated variable GManyLightsReset. They share the same value, and the console variable r.ManyLights.Reset is bound to GManyLightsReset.
Developers must be aware that this variable is intended for debugging purposes. When set to a non-zero value, it triggers a reset of the Many Lights system’s history. This reset occurs in the RenderManyLights function of the FDeferredShadingSceneRenderer class.
Best practices when using this variable include:
- Use it sparingly and only for debugging purposes.
- Reset the value to 0 after debugging to avoid continuous resets.
- Be aware that resetting the history may impact performance and visual quality temporarily.
Regarding the associated variable GManyLightsReset:
The purpose of GManyLightsReset is to serve as the internal representation of the r.ManyLights.Reset console variable. It is used within the C++ code to check when a reset is requested and to clear the reset flag after it has been processed.
This variable is set indirectly through the r.ManyLights.Reset console variable. It is checked in the RenderManyLights function to determine if a history reset is needed.
GManyLightsReset interacts directly with the r.ManyLights.Reset console variable and influences the bResetHistory flag in the RenderManyLights function.
Developers should be aware that modifying GManyLightsReset directly in code is not recommended. Instead, they should use the r.ManyLights.Reset console variable to trigger resets.
Best practices for GManyLightsReset include:
- Avoid modifying it directly in code; use the console variable instead.
- When reading its value, be aware that it may be modified from multiple threads, so proper synchronization might be necessary in certain scenarios.
- After processing the reset request, always set it back to 0 to prevent continuous resets.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ManyLights/ManyLights.cpp:100
Scope: file
Source code excerpt:
int32 GManyLightsReset = 0;
FAutoConsoleVariableRef CVarManyLightsReset(
TEXT("r.ManyLights.Reset"),
GManyLightsReset,
TEXT("Reset history for debugging."),
ECVF_RenderThreadSafe
);
int32 GManyLightsResetEveryNthFrame = 0;
#Associated Variable and Callsites
This variable is associated with another variable named GManyLightsReset
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ManyLights/ManyLights.cpp:98
Scope: file
Source code excerpt:
);
int32 GManyLightsReset = 0;
FAutoConsoleVariableRef CVarManyLightsReset(
TEXT("r.ManyLights.Reset"),
GManyLightsReset,
TEXT("Reset history for debugging."),
ECVF_RenderThreadSafe
);
int32 GManyLightsResetEveryNthFrame = 0;
FAutoConsoleVariableRef CVarManyLightsResetEveryNthFrame(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ManyLights/ManyLights.cpp:646
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::RenderManyLights
Source code excerpt:
}
if (GManyLightsReset != 0)
{
GManyLightsReset = 0;
bResetHistory = true;
}
const FIntPoint NumSamplesPerPixel2d = ManyLights::GetNumSamplesPerPixel2d();
const uint32 DownsampleFactor = 2;