r.LumenScene.SurfaceCache.CardTexelDensityScale
r.LumenScene.SurfaceCache.CardTexelDensityScale
#Overview
name: r.LumenScene.SurfaceCache.CardTexelDensityScale
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Lumen card texels per world space distance
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.SurfaceCache.CardTexelDensityScale is to control the texel density of Lumen cards in the surface cache, which is a part of Unreal Engine 5’s Lumen global illumination system. This setting determines the number of texels per world space distance for Lumen cards.
This setting variable is primarily used by the Lumen rendering system, specifically within the surface cache component of Lumen. It’s part of the Renderer module in Unreal Engine 5.
The value of this variable is set as a console variable with a default value of 100.0f. It can be modified at runtime through the console or programmatically.
The associated variable CVarLumenSceneCardTexelDensityScale interacts directly with r.LumenScene.SurfaceCache.CardTexelDensityScale, as they share the same value. This variable is used in the LumenScene::GetCardTexelDensity() function to determine the actual card texel density.
Developers should be aware that this variable affects the quality and performance of Lumen global illumination. A higher value will result in higher quality but may impact performance, while a lower value will improve performance at the cost of visual quality.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your scene and target hardware.
- Testing different values to find the optimal balance between visual quality and performance.
- Considering using different values for different quality settings in your game.
Regarding the associated variable CVarLumenSceneCardTexelDensityScale:
The purpose of CVarLumenSceneCardTexelDensityScale is to provide a programmatic interface to the r.LumenScene.SurfaceCache.CardTexelDensityScale setting.
This variable is used within the Lumen rendering system, specifically in the LumenScene class.
The value of this variable is set when the console variable r.LumenScene.SurfaceCache.CardTexelDensityScale is initialized.
It interacts with the GLumenFastCameraMode variable in the GetCardTexelDensity() function, which scales the value based on the camera mode.
Developers should be aware that changes to this variable will directly affect the Lumen surface cache’s card texel density, impacting both visual quality and performance.
Best practices for using this variable include:
- Accessing it through the GetValueOnRenderThread() method to ensure thread-safe operations.
- Considering the impact of GLumenFastCameraMode when using this value.
- Using it in conjunction with other Lumen settings to fine-tune the global illumination system for your specific use case.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneGPUDrivenUpdate.cpp:13
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarLumenSceneCardTexelDensityScale(
TEXT("r.LumenScene.SurfaceCache.CardTexelDensityScale"),
100.0f,
TEXT("Lumen card texels per world space distance"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<float> CVarLumenSceneFarFieldTexelDensity(
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenSceneCardTexelDensityScale
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneGPUDrivenUpdate.cpp:12
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<float> CVarLumenSceneCardTexelDensityScale(
TEXT("r.LumenScene.SurfaceCache.CardTexelDensityScale"),
100.0f,
TEXT("Lumen card texels per world space distance"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneGPUDrivenUpdate.cpp:81
Scope (from outer to inner):
file
function float LumenScene::GetCardTexelDensity
Source code excerpt:
float LumenScene::GetCardTexelDensity()
{
return CVarLumenSceneCardTexelDensityScale.GetValueOnRenderThread() * (GLumenFastCameraMode ? .2f : 1.0f);
}
float LumenScene::GetFarFieldCardTexelDensity()
{
return CVarLumenSceneFarFieldTexelDensity.GetValueOnRenderThread();
}