r.ManyLights.HardwareRayTracing.Inline
r.ManyLights.HardwareRayTracing.Inline
#Overview
name: r.ManyLights.HardwareRayTracing.Inline
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Uses hardware inline ray tracing for ray traced lighting, when available.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.ManyLights.HardwareRayTracing.Inline is to control the use of hardware inline ray tracing for ray traced lighting in Unreal Engine’s rendering system. This setting variable is specifically related to the ray tracing functionality within the Many Lights system.
This setting variable is primarily used in the Renderer module of Unreal Engine, specifically within the ManyLights subsystem. It’s referenced in the ManyLightsRayTracing.cpp file, which suggests it’s a part of the ray tracing implementation for the Many Lights system.
The value of this variable is set through a console variable (CVar) named CVarManyLightsHardwareRayTracingInline. It’s initialized with a default value of 1, meaning it’s enabled by default. The value can be changed at runtime through the console or configuration files.
This variable interacts closely with other ray tracing related variables and systems. For example, it’s used in conjunction with UseHardwareRayTracing() and GRHISupportsInlineRayTracing to determine if inline hardware ray tracing should be used.
Developers must be aware that this variable is render thread safe and scalability-related (as indicated by the ECVF_RenderThreadSafe and ECVF_Scalability flags). This means it can be safely changed on the render thread and may affect performance scaling.
Best practices when using this variable include:
- Only enabling it when hardware support is available.
- Considering performance implications, as ray tracing can be computationally expensive.
- Testing thoroughly with different values to find the optimal balance between visual quality and performance for your specific use case.
Regarding the associated variable CVarManyLightsHardwareRayTracingInline:
This is the actual console variable that controls the r.ManyLights.HardwareRayTracing.Inline setting. It’s an integer variable, where a non-zero value enables inline hardware ray tracing for the Many Lights system.
The purpose of this variable is to provide a runtime-configurable way to enable or disable inline hardware ray tracing. It’s used in the UseInlineHardwareRayTracing() function to determine if inline ray tracing should be used.
Developers should be aware that changes to this variable will take effect on the render thread, as it’s accessed using GetValueOnRenderThread(). This ensures thread-safe access to the variable’s value.
When using this variable, developers should consider the hardware capabilities of the target platforms and the performance requirements of their game or application. It may be beneficial to expose this setting to end-users as a graphics option, allowing them to enable or disable it based on their hardware capabilities and performance preferences.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ManyLights/ManyLightsRayTracing.cpp:49
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarManyLightsHardwareRayTracingInline(
TEXT("r.ManyLights.HardwareRayTracing.Inline"),
1,
TEXT("Uses hardware inline ray tracing for ray traced lighting, when available."),
ECVF_RenderThreadSafe | ECVF_Scalability
);
static TAutoConsoleVariable<float> CVarManyLightsHardwareRayTracingBias(
#Associated Variable and Callsites
This variable is associated with another variable named CVarManyLightsHardwareRayTracingInline
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ManyLights/ManyLightsRayTracing.cpp:48
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarManyLightsHardwareRayTracingInline(
TEXT("r.ManyLights.HardwareRayTracing.Inline"),
1,
TEXT("Uses hardware inline ray tracing for ray traced lighting, when available."),
ECVF_RenderThreadSafe | ECVF_Scalability
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ManyLights/ManyLightsRayTracing.cpp:116
Scope (from outer to inner):
file
namespace ManyLights
function bool UseInlineHardwareRayTracing
Source code excerpt:
return UseHardwareRayTracing()
&& GRHISupportsInlineRayTracing
&& CVarManyLightsHardwareRayTracingInline.GetValueOnRenderThread() != 0;
}
#else
{
return false;
}
#endif