r.Lumen.ScreenProbeGather.HairStrands.VoxelTrace
r.Lumen.ScreenProbeGather.HairStrands.VoxelTrace
#Overview
name: r.Lumen.ScreenProbeGather.HairStrands.VoxelTrace
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to trace against hair voxel structure for hair casting shadow onto opaques.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ScreenProbeGather.HairStrands.VoxelTrace is to control whether to trace against the hair voxel structure for hair casting shadows onto opaque surfaces in Unreal Engine’s Lumen lighting system.
This setting variable is primarily used in the Lumen rendering system, specifically for screen probe gathering and hair strand rendering. It is part of the Unreal Engine’s renderer module.
The value of this variable is set through the engine’s console variable system. It is initialized with a default value of 1 (enabled) and can be modified at runtime.
The associated C++ variable GLumenScreenProbeGatherHairStrands_VoxelTrace interacts directly with this console variable. They share the same value, and changes to one will affect the other.
Developers should be aware that:
- This variable affects the rendering performance and visual quality of hair shadows on opaque surfaces.
- It is specific to the voxel-based hair rendering technique in Lumen.
- It is a scalability option, meaning it can be adjusted based on performance requirements.
Best practices when using this variable include:
- Consider disabling it on lower-end hardware if performance is an issue.
- Test the visual impact of enabling/disabling this feature in scenes with significant hair rendering.
- Use in conjunction with other Lumen and hair rendering settings for optimal results.
Regarding the associated variable GLumenScreenProbeGatherHairStrands_VoxelTrace:
- Its purpose is to store the runtime value of the console variable in the C++ code.
- It is used in the Lumen screen probe tracing logic to determine whether to include hair voxel tracing.
- It is set directly by the console variable system and should not be modified directly in code.
- Developers should read this variable when implementing rendering logic that needs to know if hair voxel tracing is enabled.
- Best practice is to treat this as a read-only variable in most scenarios, allowing the console variable system to manage its value.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeTracing.cpp:97
Scope: file
Source code excerpt:
int32 GLumenScreenProbeGatherHairStrands_VoxelTrace = 1;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherHairStrands_VoxelTrace(
TEXT("r.Lumen.ScreenProbeGather.HairStrands.VoxelTrace"),
GLumenScreenProbeGatherHairStrands_VoxelTrace,
TEXT("Whether to trace against hair voxel structure for hair casting shadow onto opaques."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenScreenProbeGatherHairStrands_ScreenTrace = 0;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenScreenProbeGatherHairStrands_VoxelTrace
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeTracing.cpp:95
Scope: file
Source code excerpt:
);
int32 GLumenScreenProbeGatherHairStrands_VoxelTrace = 1;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherHairStrands_VoxelTrace(
TEXT("r.Lumen.ScreenProbeGather.HairStrands.VoxelTrace"),
GLumenScreenProbeGatherHairStrands_VoxelTrace,
TEXT("Whether to trace against hair voxel structure for hair casting shadow onto opaques."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenScreenProbeGatherHairStrands_ScreenTrace = 0;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherHairStrands_ScreenTrace(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeTracing.cpp:747
Scope (from outer to inner):
file
function void TraceScreenProbes
Source code excerpt:
}
bool bNeedTraceHairVoxel = HairStrands::HasViewHairStrandsVoxelData(View) && GLumenScreenProbeGatherHairStrands_VoxelTrace > 0;
const bool bUseHardwareRayTracing = Lumen::UseHardwareRayTracedScreenProbeGather(*View.Family);
if (bUseHardwareRayTracing)
{
RenderHardwareRayTracingScreenProbe(
GraphBuilder,