r.Lumen.Visualize.HardwareRayTracing.DeferredMaterial
r.Lumen.Visualize.HardwareRayTracing.DeferredMaterial
#Overview
name: r.Lumen.Visualize.HardwareRayTracing.DeferredMaterial
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables deferred material pipeline (Default = 1)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Visualize.HardwareRayTracing.DeferredMaterial is to enable or disable the deferred material pipeline in Lumen’s hardware ray tracing visualization system. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically for its visualization and debugging features.
This setting variable is primarily used in the Renderer module of Unreal Engine 5, particularly in the Lumen subsystem. It’s referenced in the LumenVisualizeHardwareRayTracing.cpp file, which suggests it’s used for visualizing and debugging hardware ray tracing in Lumen.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1, meaning the deferred material pipeline is enabled by default. Developers can change this value at runtime using console commands or through project settings.
The associated variable CVarLumenVisualizeHardwareRayTracingDeferredMaterial directly interacts with this setting. It’s used to retrieve the current value of the setting in the render thread.
Developers should be aware that this setting affects the visualization of hardware ray tracing in Lumen. When enabled (set to 1), it uses a deferred material pipeline, which might impact performance and visual output. When disabled (set to 0), it likely uses an alternative, possibly forward, rendering approach for materials.
Best practices when using this variable include:
- Only modify it when specifically working on or debugging Lumen’s hardware ray tracing visualization.
- Be aware of potential performance implications when enabling or disabling the deferred material pipeline.
- Use in conjunction with other Lumen visualization tools for comprehensive debugging.
Regarding the associated variable CVarLumenVisualizeHardwareRayTracingDeferredMaterial:
The purpose of CVarLumenVisualizeHardwareRayTracingDeferredMaterial is to provide a programmatic way to access and modify the r.Lumen.Visualize.HardwareRayTracing.DeferredMaterial setting within the C++ code of the engine.
This variable is used in the Renderer module, specifically in the Lumen namespace, to determine whether to use deferred materials in the hardware ray tracing visualization process.
The value of this variable is set through the CVar system, mirroring the r.Lumen.Visualize.HardwareRayTracing.DeferredMaterial setting.
It interacts directly with the FHardwareRayTracingPermutationSettings struct, influencing the bUseDeferredMaterial flag based on its value.
Developers should be aware that this variable is checked on the render thread, which means changes to it will be reflected in the next frame.
Best practices for using this variable include:
- Access it using the GetValueOnRenderThread() method to ensure thread-safe operations.
- Consider the implications of changing this value on overall rendering performance and visual output.
- Use it in conjunction with other Lumen settings for a cohesive visualization and debugging experience.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeHardwareRayTracing.cpp:32
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarLumenVisualizeHardwareRayTracingDeferredMaterial(
TEXT("r.Lumen.Visualize.HardwareRayTracing.DeferredMaterial"),
1,
TEXT("Enables deferred material pipeline (Default = 1)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarLumenVisualizeHardwareRayTracingDeferredMaterialTileSize(
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenVisualizeHardwareRayTracingDeferredMaterial
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeHardwareRayTracing.cpp:31
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarLumenVisualizeHardwareRayTracingDeferredMaterial(
TEXT("r.Lumen.Visualize.HardwareRayTracing.DeferredMaterial"),
1,
TEXT("Enables deferred material pipeline (Default = 1)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeHardwareRayTracing.cpp:111
Scope (from outer to inner):
file
namespace Lumen
function FHardwareRayTracingPermutationSettings GetVisualizeHardwareRayTracingPermutationSettings
Source code excerpt:
ModesAndPermutationSettings.LightingMode = GetHardwareRayTracingLightingMode(View, bLumenGIEnabled);
ModesAndPermutationSettings.bUseMinimalPayload = (ModesAndPermutationSettings.LightingMode == Lumen::EHardwareRayTracingLightingMode::LightingFromSurfaceCache);
ModesAndPermutationSettings.bUseDeferredMaterial = (CVarLumenVisualizeHardwareRayTracingDeferredMaterial.GetValueOnRenderThread()) != 0 && !ModesAndPermutationSettings.bUseMinimalPayload;
return ModesAndPermutationSettings;
}
#endif
} // namespace Lumen
namespace LumenVisualize