r.RayTracing.AllowInline
r.RayTracing.AllowInline
#Overview
name: r.RayTracing.AllowInline
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allow use of Inline Ray Tracing if supported (default=1).
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.RayTracing.AllowInline is to control whether inline ray tracing is allowed in the rendering system of Unreal Engine 5. Inline ray tracing is a specific technique within the ray tracing framework that can potentially offer performance benefits in certain scenarios.
This setting variable is primarily used in the rendering subsystem of Unreal Engine 5, specifically within the deferred shading renderer. It’s part of the ray tracing implementation, which is a advanced rendering technique used for creating highly realistic graphics.
The value of this variable is set through a console variable (CVarRayTracingAllowInline) with a default value of 1 (enabled). It can be changed at runtime through the console or configuration files.
The associated variable GRayTracingAllowInline interacts directly with r.RayTracing.AllowInline. They share the same initial value, and GRayTracingAllowInline is used in the actual code logic to determine if inline ray tracing should be allowed.
Developers must be aware that this setting is render thread safe, meaning it can be changed safely during runtime without causing threading issues. However, they should also note that this setting is dependent on hardware support (GRHISupportsInlineRayTracing) and is used in conjunction with other ray tracing settings like pipeline compatibility flags.
Best practices when using this variable include:
- Ensuring the target hardware supports inline ray tracing before enabling it.
- Testing performance with and without inline ray tracing enabled to determine the best setting for your specific use case.
- Considering the interaction with other ray tracing settings and pipeline compatibility flags.
Regarding the associated variable CVarRayTracingAllowInline:
The purpose of CVarRayTracingAllowInline is to provide a console-accessible way to control the r.RayTracing.AllowInline setting. It’s part of the console variable system in Unreal Engine, which allows for runtime configuration of engine settings.
This console variable is used in the rendering subsystem, specifically in the deferred shading renderer, to determine whether inline ray tracing should be allowed.
The value of CVarRayTracingAllowInline is initially set to the same value as GRayTracingAllowInline (which is 1 by default), but it can be changed at runtime through the console.
CVarRayTracingAllowInline interacts directly with GRayTracingAllowInline and indirectly with other ray tracing settings.
Developers should be aware that changes to this console variable will take effect on the render thread, as indicated by the ECVF_RenderThreadSafe flag.
Best practices for using CVarRayTracingAllowInline include:
- Using it for debugging or performance testing purposes.
- Being cautious about changing it in shipping builds, as it could affect performance or visual quality.
- Considering its interaction with other ray tracing settings when modifying it.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DeferredShadingRenderer.cpp:177
Scope: file
Source code excerpt:
static int32 GRayTracingAllowInline = 1;
static TAutoConsoleVariable<int32> CVarRayTracingAllowInline(
TEXT("r.RayTracing.AllowInline"),
GRayTracingAllowInline,
TEXT("Allow use of Inline Ray Tracing if supported (default=1)."),
ECVF_RenderThreadSafe);
static int32 GRayTracingAllowPipeline = 1;
static TAutoConsoleVariable<int32> CVarRayTracingAllowPipeline(
#Associated Variable and Callsites
This variable is associated with another variable named CVarRayTracingAllowInline
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DeferredShadingRenderer.cpp:176
Scope: file
Source code excerpt:
static int32 GRayTracingAllowInline = 1;
static TAutoConsoleVariable<int32> CVarRayTracingAllowInline(
TEXT("r.RayTracing.AllowInline"),
GRayTracingAllowInline,
TEXT("Allow use of Inline Ray Tracing if supported (default=1)."),
ECVF_RenderThreadSafe);
static int32 GRayTracingAllowPipeline = 1;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DeferredShadingRenderer.cpp:3483
Scope (from outer to inner):
file
function bool ShouldRenderRayTracingEffect
Source code excerpt:
const bool bAllowInline = GRHISupportsInlineRayTracing &&
CVarRayTracingAllowInline.GetValueOnRenderThread() &&
EnumHasAnyFlags(CompatibilityFlags, ERayTracingPipelineCompatibilityFlags::Inline);
// Disable the effect if current machine does not support the full ray tracing pipeline and the effect can't fall back to inline mode or vice versa.
if (!bAllowPipeline && !bAllowInline)
{
return false;