r.PathTracing.UseAnalyticTransmittance
r.PathTracing.UseAnalyticTransmittance
#Overview
name: r.PathTracing.UseAnalyticTransmittance
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Determines use of analytical or null-tracking estimation when evaluating transmittance\n-1: uses null-tracking estimation if heterogeneous volumes are present, or analytical estimation otherwise (default)\n0: off (uses null-tracking estimation, instead)\n1: on (uses analytical estimation)\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.PathTracing.UseAnalyticTransmittance is to control the method used for evaluating transmittance in the path tracing rendering system of Unreal Engine 5. It determines whether to use analytical estimation or null-tracking estimation when calculating light transmission through volumes in a scene.
This setting variable is primarily used in the rendering system, specifically in the path tracing module of Unreal Engine 5. Based on the callsites, it’s evident that this variable is utilized in the Renderer module, particularly in the PathTracing.cpp file.
The value of this variable is set through a console variable (CVarPathTracingUseAnalyticTransmittance) with three possible options: -1: Default value, which uses null-tracking estimation if heterogeneous volumes are present, or analytical estimation otherwise. 0: Uses null-tracking estimation. 1: Uses analytical estimation.
The associated variable CVarPathTracingUseAnalyticTransmittance directly interacts with r.PathTracing.UseAnalyticTransmittance. They share the same value and purpose.
Developers must be aware that this variable affects the accuracy and performance of light transmission calculations in path tracing. The choice between analytical and null-tracking estimation can impact both rendering quality and performance, especially in scenes with complex volumetric effects.
Best practices when using this variable include:
- Leave it at the default value (-1) unless specific issues arise with transmittance calculation.
- If experiencing performance issues in scenes with heterogeneous volumes, consider setting it to 1 to force analytical estimation.
- For scenes with complex, non-uniform volumetric effects, setting it to 0 might provide more accurate results at the cost of performance.
- Test thoroughly with different settings in various lighting conditions and scene compositions to find the optimal balance between quality and performance for your specific project.
Regarding the associated variable CVarPathTracingUseAnalyticTransmittance: This is an internal console variable that directly controls the behavior defined by r.PathTracing.UseAnalyticTransmittance. It’s used in the EvalUseAnalyticTransmittance function to determine whether to use analytical or null-tracking estimation based on the presence of heterogeneous volumes in the view. Developers typically don’t need to interact with this variable directly, as it’s managed through the r.PathTracing.UseAnalyticTransmittance setting.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracing.cpp:383
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarPathTracingUseAnalyticTransmittance(
TEXT("r.PathTracing.UseAnalyticTransmittance"),
-1,
TEXT("Determines use of analytical or null-tracking estimation when evaluating transmittance\n")
TEXT("-1: uses null-tracking estimation if heterogeneous volumes are present, or analytical estimation otherwise (default)\n")
TEXT("0: off (uses null-tracking estimation, instead)\n")
TEXT("1: on (uses analytical estimation)\n"),
ECVF_RenderThreadSafe
#Associated Variable and Callsites
This variable is associated with another variable named CVarPathTracingUseAnalyticTransmittance
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracing.cpp:382
Scope: file
Source code excerpt:
);
TAutoConsoleVariable<int32> CVarPathTracingUseAnalyticTransmittance(
TEXT("r.PathTracing.UseAnalyticTransmittance"),
-1,
TEXT("Determines use of analytical or null-tracking estimation when evaluating transmittance\n")
TEXT("-1: uses null-tracking estimation if heterogeneous volumes are present, or analytical estimation otherwise (default)\n")
TEXT("0: off (uses null-tracking estimation, instead)\n")
TEXT("1: on (uses analytical estimation)\n"),
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracing.cpp:601
Scope (from outer to inner):
file
function static bool EvalUseAnalyticTransmittance
Source code excerpt:
static bool EvalUseAnalyticTransmittance(const FViewInfo& View)
{
int32 UseAnalyticTransmittance = CVarPathTracingUseAnalyticTransmittance.GetValueOnRenderThread();
if (UseAnalyticTransmittance < 0)
{
UseAnalyticTransmittance = !ShouldRenderHeterogeneousVolumesForView(View);
}
return UseAnalyticTransmittance != 0;