r.Lumen.HardwareRayTracing.HitLighting.ReflectionCaptures

r.Lumen.HardwareRayTracing.HitLighting.ReflectionCaptures

#Overview

name: r.Lumen.HardwareRayTracing.HitLighting.ReflectionCaptures

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Lumen.HardwareRayTracing.HitLighting.ReflectionCaptures is to control whether Reflection Captures are applied to ray hits when using Hit Lighting in Lumen’s hardware ray tracing system.

This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. Specifically, it’s utilized in the hardware ray tracing component of Lumen, which is part of the engine’s global illumination solution.

The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with an initial value of 0, meaning Reflection Captures are not applied by default.

The associated variable CVarLumenHardwareRayTracingHitLightingReflectionCaptures directly interacts with this setting. It’s the C++ representation of the console variable and is used to retrieve the current value of the setting in the engine’s code.

Developers must be aware that this variable is render thread safe and scalable, as indicated by the ECVF_RenderThreadSafe and ECVF_Scalability flags. This means it can be changed at runtime without causing thread safety issues, and it can be adjusted based on the hardware capabilities or performance requirements.

Best practices when using this variable include:

  1. Only enabling it when higher quality lighting is required, as it may have performance implications.
  2. Testing the impact on performance and visual quality when enabling or disabling this feature.
  3. Considering the interaction with other Lumen and ray tracing settings for optimal results.

Regarding the associated variable CVarLumenHardwareRayTracingHitLightingReflectionCaptures:

Developers should use this associated variable when they need to check the current state of the setting in C++ code, particularly within the Lumen subsystem or related rendering code.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenHardwareRayTracingCommon.cpp:38

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarLumenHardwareRayTracingHitLightingReflectionCaptures(
	TEXT("r.Lumen.HardwareRayTracing.HitLighting.ReflectionCaptures"),
	0,
	TEXT("Whether to apply Reflection Captures to ray hits when using Hit Lighting."),
	ECVF_RenderThreadSafe | ECVF_Scalability
);

static TAutoConsoleVariable<int32> CVarLumenUseHardwareRayTracingInline(

#Associated Variable and Callsites

This variable is associated with another variable named CVarLumenHardwareRayTracingHitLightingReflectionCaptures. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenHardwareRayTracingCommon.cpp:37

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<int32> CVarLumenHardwareRayTracingHitLightingReflectionCaptures(
	TEXT("r.Lumen.HardwareRayTracing.HitLighting.ReflectionCaptures"),
	0,
	TEXT("Whether to apply Reflection Captures to ray hits when using Hit Lighting."),
	ECVF_RenderThreadSafe | ECVF_Scalability
);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenHardwareRayTracingCommon.cpp:154

Scope (from outer to inner):

file
function     bool Lumen::UseReflectionCapturesForHitLighting

Source code excerpt:

bool Lumen::UseReflectionCapturesForHitLighting()
{
	int32 UseReflectionCaptures = CVarLumenHardwareRayTracingHitLightingReflectionCaptures.GetValueOnRenderThread();
	return UseReflectionCaptures != 0;
}

bool Lumen::UseHardwareInlineRayTracing(const FSceneViewFamily& ViewFamily)
{
#if RHI_RAYTRACING