r.SSGI.RejectUncertainRays
r.SSGI.RejectUncertainRays
#Overview
name: r.SSGI.RejectUncertainRays
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Rejects the screen space ray if it was uncertain due to going behind screen geometry.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SSGI.RejectUncertainRays is to control the rejection of uncertain screen space rays in the Screen Space Global Illumination (SSGI) system. This setting is part of the rendering system in Unreal Engine 5, specifically related to global illumination calculations.
This setting variable is primarily used in the Renderer module of Unreal Engine 5, as evidenced by its location in the ScreenSpaceRayTracing.cpp file within the Runtime/Renderer/Private directory.
The value of this variable is set through a console variable (CVar) system, which allows for runtime configuration. It is initialized with a default value of 1, meaning that by default, uncertain rays are rejected.
The associated variable CVarSSGIRejectUncertainRays directly interacts with r.SSGI.RejectUncertainRays. They share the same value and purpose.
Developers must be aware that this variable affects the accuracy and performance of the SSGI system. When enabled (set to 1), it rejects screen space rays that are uncertain due to going behind screen geometry. This can improve performance but may affect the quality of global illumination in certain scenarios.
Best practices when using this variable include:
- Testing the visual impact of enabling/disabling this feature in different scenes.
- Considering the performance implications, especially in complex scenes with many occluded areas.
- Balancing this setting with other SSGI-related variables for optimal results.
Regarding the associated variable CVarSSGIRejectUncertainRays:
- It is an internal representation of the r.SSGI.RejectUncertainRays console variable.
- It is used to retrieve the current value of the setting in the rendering code, as seen in the SetupCommonScreenSpaceRayParameters function.
- Developers should use this variable when they need to access the current state of the r.SSGI.RejectUncertainRays setting within C++ code.
- It’s important to note that this variable is marked with ECVF_Scalability and ECVF_RenderThreadSafe flags, indicating that it affects scalability and is safe to use on the render thread.
When working with both r.SSGI.RejectUncertainRays and CVarSSGIRejectUncertainRays, developers should ensure consistent usage across the codebase and consider the impact on both visual quality and performance in their specific use cases.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceRayTracing.cpp:62
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarSSGIRejectUncertainRays(
TEXT("r.SSGI.RejectUncertainRays"), 1,
TEXT("Rejects the screen space ray if it was uncertain due to going behind screen geometry."),
ECVF_Scalability | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarSSGITerminateCertainRay(
TEXT("r.SSGI.TerminateCertainRay"), 1,
TEXT("Optimisations that if the screen space ray is certain and didn't find any geometry, don't fallback on otehr tracing technic."),
#Associated Variable and Callsites
This variable is associated with another variable named CVarSSGIRejectUncertainRays
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceRayTracing.cpp:61
Scope: file
Source code excerpt:
ECVF_Scalability | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarSSGIRejectUncertainRays(
TEXT("r.SSGI.RejectUncertainRays"), 1,
TEXT("Rejects the screen space ray if it was uncertain due to going behind screen geometry."),
ECVF_Scalability | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarSSGITerminateCertainRay(
TEXT("r.SSGI.TerminateCertainRay"), 1,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceRayTracing.cpp:247
Scope (from outer to inner):
file
namespace ScreenSpaceRayTracing
function void SetupCommonScreenSpaceRayParameters
Source code excerpt:
OutParameters->DebugOutput = CreateScreenSpaceRayTracingDebugUAV(GraphBuilder, SceneTextures.SceneDepthTexture->Desc, TEXT("DebugSSRT"));
OutParameters->bRejectUncertainRays = CVarSSGIRejectUncertainRays.GetValueOnRenderThread() ? 1 : 0;
OutParameters->bTerminateCertainRay = CVarSSGITerminateCertainRay.GetValueOnRenderThread() ? 1 : 0;
} // SetupCommonScreenSpaceRayParameters()
void SetupCommonScreenSpaceRayParameters(
FRDGBuilder& GraphBuilder,
const HybridIndirectLighting::FCommonParameters& CommonDiffuseParameters,