r.Lumen.Reflections.HardwareRayTracing

r.Lumen.Reflections.HardwareRayTracing

#Overview

name: r.Lumen.Reflections.HardwareRayTracing

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.Reflections.HardwareRayTracing is to enable or disable hardware ray tracing for Lumen reflections in Unreal Engine 5. This setting variable is part of the rendering system, specifically for the Lumen global illumination and reflection system.

This setting variable is primarily used in the Lumen reflection subsystem within the Renderer module of Unreal Engine 5. Based on the callsites, it is referenced in the LumenReflectionHardwareRayTracing.cpp file, which is part of the Lumen reflection implementation.

The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of 1, meaning hardware ray tracing for Lumen reflections is enabled by default.

The associated variable CVarLumenReflectionsHardwareRayTracing interacts directly with r.Lumen.Reflections.HardwareRayTracing. They share the same value and purpose.

Developers must be aware that this variable is marked with ECVF_Scalability and ECVF_RenderThreadSafe flags. This means it can be adjusted for performance scaling and can be safely modified from the render thread.

Best practices when using this variable include:

  1. Only disable it if you’re experiencing performance issues related to ray-traced reflections.
  2. Consider the visual impact of disabling hardware ray tracing for reflections before making changes.
  3. Use it in conjunction with other Lumen settings for optimal performance and visual quality.

Regarding the associated variable CVarLumenReflectionsHardwareRayTracing:

The purpose of CVarLumenReflectionsHardwareRayTracing is the same as r.Lumen.Reflections.HardwareRayTracing - to control the use of hardware ray tracing for Lumen reflections.

It is used in the Lumen namespace, specifically in the UseHardwareRayTracedReflections function, which determines whether hardware ray-traced reflections should be used for a given view family.

The value is set through the CVar system and can be accessed using the GetValueOnAnyThread() method.

This variable interacts with other conditions such as IsRayTracingEnabled() and Lumen::UseHardwareRayTracing(ViewFamily) to determine the final state of hardware ray-traced reflections.

Developers should be aware that this variable is checked on the render thread, so changes may not take effect immediately.

Best practices include using this variable in conjunction with other ray tracing and Lumen settings for optimal performance and visual quality, and considering the hardware requirements and performance impact of enabling hardware ray tracing.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflectionHardwareRayTracing.cpp:20

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarLumenReflectionsHardwareRayTracing(
	TEXT("r.Lumen.Reflections.HardwareRayTracing"),
	1,
	TEXT("Enables hardware ray tracing for Lumen reflections (Default = 1)"),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

static TAutoConsoleVariable<int32> CVarLumenReflectionsHardwareRayTracingBucketMaterials(

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflectionHardwareRayTracing.cpp:19

Scope: file

Source code excerpt:

#include "LumenHardwareRayTracingCommon.h"

static TAutoConsoleVariable<int32> CVarLumenReflectionsHardwareRayTracing(
	TEXT("r.Lumen.Reflections.HardwareRayTracing"),
	1,
	TEXT("Enables hardware ray tracing for Lumen reflections (Default = 1)"),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflectionHardwareRayTracing.cpp:55

Scope (from outer to inner):

file
namespace    Lumen
function     bool UseHardwareRayTracedReflections

Source code excerpt:

		return IsRayTracingEnabled() 
			&& Lumen::UseHardwareRayTracing(ViewFamily) 
			&& (CVarLumenReflectionsHardwareRayTracing.GetValueOnAnyThread() != 0);
#else
		return false;
#endif
	}
} // namespace Lumen