r.LumenScene.GlobalSDF.Resolution
r.LumenScene.GlobalSDF.Resolution
#Overview
name: r.LumenScene.GlobalSDF.Resolution
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Global Distance Field resolution when Lumen is enabled.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.GlobalSDF.Resolution is to control the resolution of the Global Distance Field used by the Lumen lighting system in Unreal Engine 5. This setting variable is specifically for the rendering system, particularly the Lumen global illumination feature.
This setting variable is primarily used in the Renderer module, specifically within the Lumen subsystem. Based on the callsites, it’s clear that this variable is crucial for the Lumen scene rendering process.
The value of this variable is set through the console variable system in Unreal Engine. It’s initialized with a default value of 252 and can be modified at runtime using console commands or through project settings.
The associated variable GLumenSceneGlobalDFResolution directly interacts with r.LumenScene.GlobalSDF.Resolution. They share the same value, with GLumenSceneGlobalDFResolution being the actual integer variable used in the C++ code to store and access the resolution value.
Developers must be aware that changing this variable will affect the quality and performance of the Lumen global illumination system. A higher resolution will provide more detailed lighting but at the cost of increased memory usage and potentially lower performance.
Best practices when using this variable include:
- Balancing quality and performance by finding the optimal resolution for your specific project needs.
- Testing different values to find the sweet spot between visual quality and performance for your target hardware.
- Considering scalability options, potentially adjusting this value based on different quality settings in your game.
Regarding the associated variable GLumenSceneGlobalDFResolution:
The purpose of GLumenSceneGlobalDFResolution is to store and provide access to the Global Distance Field resolution value within the C++ code of the Lumen system.
This variable is used directly in the Renderer module, specifically in the Lumen subsystem. It’s accessed through the Lumen::GetGlobalDFResolution() function, which suggests it’s used in various parts of the Lumen rendering pipeline.
The value of GLumenSceneGlobalDFResolution is set by the console variable system, mirroring the value of r.LumenScene.GlobalSDF.Resolution.
GLumenSceneGlobalDFResolution interacts directly with r.LumenScene.GlobalSDF.Resolution, serving as its C++ representation within the engine code.
Developers should be aware that modifying GLumenSceneGlobalDFResolution directly in code is not recommended, as it should be controlled through the console variable system to maintain consistency.
Best practices for GLumenSceneGlobalDFResolution include:
- Using the Lumen::GetGlobalDFResolution() function to access its value rather than accessing the variable directly.
- Avoiding direct modification of this variable in code, instead using the console variable system to change its value when needed.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScene.cpp:9
Scope: file
Source code excerpt:
int32 GLumenSceneGlobalDFResolution = 252;
FAutoConsoleVariableRef CVarLumenSceneGlobalDFResolution(
TEXT("r.LumenScene.GlobalSDF.Resolution"),
GLumenSceneGlobalDFResolution,
TEXT("Global Distance Field resolution when Lumen is enabled."),
ECVF_RenderThreadSafe
);
float GLumenSceneGlobalDFClipmapExtent = 2500.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenSceneGlobalDFResolution
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScene.cpp:7
Scope: file
Source code excerpt:
#include "InstanceDataSceneProxy.h"
int32 GLumenSceneGlobalDFResolution = 252;
FAutoConsoleVariableRef CVarLumenSceneGlobalDFResolution(
TEXT("r.LumenScene.GlobalSDF.Resolution"),
GLumenSceneGlobalDFResolution,
TEXT("Global Distance Field resolution when Lumen is enabled."),
ECVF_RenderThreadSafe
);
float GLumenSceneGlobalDFClipmapExtent = 2500.0f;
FAutoConsoleVariableRef CVarLumenSceneGlobalDFClipmapExtent(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScene.cpp:112
Scope (from outer to inner):
file
function int32 Lumen::GetGlobalDFResolution
Source code excerpt:
int32 Lumen::GetGlobalDFResolution()
{
return GLumenSceneGlobalDFResolution;
}
float Lumen::GetGlobalDFClipmapExtent(int32 ClipmapIndex)
{
return GLumenSceneGlobalDFClipmapExtent * FMath::Pow(2.0f, ClipmapIndex);
}