r.RayTracing.Shadows.MaxTranslucencyHitCount
r.RayTracing.Shadows.MaxTranslucencyHitCount
#Overview
name: r.RayTracing.Shadows.MaxTranslucencyHitCount
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
-1: Evaluate all intersections (default). 0: Disable translucent shadow testing.>0: Limit the number of intersections.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.RayTracing.Shadows.MaxTranslucencyHitCount is to control the number of intersections evaluated for translucent shadow testing in ray-traced shadows. This setting variable is part of Unreal Engine 5’s ray tracing system, specifically for shadow rendering.
This setting variable is primarily used by the Renderer module, particularly in the ray tracing subsystem for shadows. It’s referenced in the RayTracingShadows.cpp file, which is part of the ray-traced shadow implementation.
The value of this variable is set through a console variable (CVarRayTracingShadowsMaxTranslucencyHitCount) using the TAutoConsoleVariable template. It can be modified at runtime through console commands or programmatically.
The associated variable CVarRayTracingShadowsMaxTranslucencyHitCount directly interacts with r.RayTracing.Shadows.MaxTranslucencyHitCount. They share the same value and purpose.
Developers must be aware that:
- The default value is -1, which evaluates all intersections.
- Setting it to 0 disables translucent shadow testing.
- Values greater than 0 limit the number of intersections evaluated.
Best practices when using this variable include:
- Use -1 for the highest quality shadows, but be aware of potential performance impact.
- Use 0 to disable translucent shadows if they’re not needed or for performance optimization.
- Experiment with values >0 to find a balance between shadow quality and performance.
- Consider the scene complexity and the importance of accurate translucent shadows when adjusting this value.
Regarding the associated variable CVarRayTracingShadowsMaxTranslucencyHitCount:
- It’s an internal representation of the r.RayTracing.Shadows.MaxTranslucencyHitCount setting.
- It’s used to retrieve the current value of the setting in the GetRayTracingShadowsMaxTranslucencyHitCount() function.
- This function is likely called by other parts of the ray tracing system to determine how many translucent intersections should be evaluated for shadows.
- Developers should use the console variable (r.RayTracing.Shadows.MaxTranslucencyHitCount) to modify the setting rather than directly manipulating CVarRayTracingShadowsMaxTranslucencyHitCount.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/RayTracing/RayTracingShadows.cpp:117
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarRayTracingShadowsMaxTranslucencyHitCount(
TEXT("r.RayTracing.Shadows.MaxTranslucencyHitCount"),
-1,
TEXT("-1: Evaluate all intersections (default).")
TEXT(" 0: Disable translucent shadow testing.")
TEXT(">0: Limit the number of intersections."),
ECVF_RenderThreadSafe
);
#Associated Variable and Callsites
This variable is associated with another variable named CVarRayTracingShadowsMaxTranslucencyHitCount
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/RayTracing/RayTracingShadows.cpp:116
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarRayTracingShadowsMaxTranslucencyHitCount(
TEXT("r.RayTracing.Shadows.MaxTranslucencyHitCount"),
-1,
TEXT("-1: Evaluate all intersections (default).")
TEXT(" 0: Disable translucent shadow testing.")
TEXT(">0: Limit the number of intersections."),
ECVF_RenderThreadSafe
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/RayTracing/RayTracingShadows.cpp:127
Scope (from outer to inner):
file
function int32 GetRayTracingShadowsMaxTranslucencyHitCount
Source code excerpt:
int32 GetRayTracingShadowsMaxTranslucencyHitCount()
{
return CVarRayTracingShadowsMaxTranslucencyHitCount.GetValueOnRenderThread();
}
bool EnableRayTracingShadowTwoSidedGeometry()
{
return CVarRayTracingShadowsEnableTwoSidedGeometry.GetValueOnRenderThread() != 0;
}