r.PathTracing.AtmosphereOpticalDepthLUTNumSamples
r.PathTracing.AtmosphereOpticalDepthLUTNumSamples
#Overview
name: r.PathTracing.AtmosphereOpticalDepthLUTNumSamples
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Number of ray marching samples used when building the transmittance lookup texture used for transmittance calculations by the path tracer in reference atmosphere mode. (default = 16384)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.PathTracing.AtmosphereOpticalDepthLUTNumSamples is to control the number of ray marching samples used when building the transmittance lookup texture for atmosphere rendering in the path tracing system of Unreal Engine 5.
This setting variable is primarily used by the rendering system, specifically the path tracing module within Unreal Engine 5. Based on the callsites, it’s evident that this variable is utilized in the PathTracing.cpp file, which is part of the Renderer module.
The value of this variable is set through a console variable (CVarPathTracingAtmosphereOpticalDepthLutNumSamples) with a default value of 16384. It can be modified at runtime using console commands or through engine configuration files.
The associated variable CVarPathTracingAtmosphereOpticalDepthLutNumSamples directly interacts with r.PathTracing.AtmosphereOpticalDepthLUTNumSamples. They share the same value and purpose.
Developers should be aware that this variable affects the quality and performance of atmosphere rendering in path tracing mode. A higher number of samples will result in more accurate atmospheric effects but may impact performance.
Best practices when using this variable include:
- Adjusting the value based on the specific needs of the project, balancing between visual quality and performance.
- Testing different values to find the optimal balance for your specific scene and hardware targets.
- Considering lower values for less demanding scenes or lower-end hardware, and higher values for more realistic atmospheric effects in high-end configurations.
Regarding the associated variable CVarPathTracingAtmosphereOpticalDepthLutNumSamples:
- It is an internal representation of the r.PathTracing.AtmosphereOpticalDepthLUTNumSamples console variable.
- It’s used to retrieve the current value of the setting in the rendering code, specifically in the FAtmosphereConfig constructor.
- Developers should use this variable when they need to access the current value of the setting in C++ code, particularly within the rendering pipeline.
- Any changes to the console variable will be reflected in this associated variable, ensuring consistency throughout the rendering system.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracing.cpp:200
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarPathTracingAtmosphereOpticalDepthLutNumSamples(
TEXT("r.PathTracing.AtmosphereOpticalDepthLUTNumSamples"),
16384,
TEXT("Number of ray marching samples used when building the transmittance lookup texture used for transmittance calculations by the path tracer in reference atmosphere mode. (default = 16384)"),
ECVF_RenderThreadSafe
);
TAutoConsoleVariable<int32> CVarPathTracingFrameIndependentTemporalSeed(
#Associated Variable and Callsites
This variable is associated with another variable named CVarPathTracingAtmosphereOpticalDepthLutNumSamples
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracing.cpp:199
Scope: file
Source code excerpt:
);
TAutoConsoleVariable<int32> CVarPathTracingAtmosphereOpticalDepthLutNumSamples(
TEXT("r.PathTracing.AtmosphereOpticalDepthLUTNumSamples"),
16384,
TEXT("Number of ray marching samples used when building the transmittance lookup texture used for transmittance calculations by the path tracer in reference atmosphere mode. (default = 16384)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracing.cpp:520
Scope (from outer to inner):
file
function FAtmosphereConfig
Source code excerpt:
FAtmosphereConfig(const FAtmosphereUniformShaderParameters& Parameters) :
AtmoParameters(Parameters),
NumSamples(CVarPathTracingAtmosphereOpticalDepthLutNumSamples.GetValueOnRenderThread()),
Resolution(CVarPathTracingAtmosphereOpticalDepthLutResolution.GetValueOnRenderThread()) {}
bool IsDifferent(const FAtmosphereConfig& Other) const
{
// Compare only those parameters which impact the LUT construction
return