r.HeterogeneousVolumes.IndirectLighting
r.HeterogeneousVolumes.IndirectLighting
#Overview
name: r.HeterogeneousVolumes.IndirectLighting
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables indirect lighting (Default = 0)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HeterogeneousVolumes.IndirectLighting is to enable or disable indirect lighting for heterogeneous volumes in Unreal Engine’s rendering system.
This setting variable is primarily used in the Renderer module, specifically within the HeterogeneousVolumes subsystem. It affects the rendering of volumetric effects with varying densities and properties.
The value of this variable is set through the console variable system in Unreal Engine. It is initialized with a default value of 0, which means indirect lighting for heterogeneous volumes is disabled by default.
The variable interacts directly with its associated C++ variable CVarHeterogeneousVolumesIndirectLighting. This relationship allows the engine to efficiently access the current setting value during runtime.
Developers should be aware that this variable is render thread safe, meaning it can be safely modified from different threads without causing race conditions or other threading issues. However, changes to this variable will only take effect on the render thread.
Best practices when using this variable include:
- Only enabling it when necessary, as it may have performance implications.
- Testing the visual impact and performance with both enabled and disabled states.
- Considering the interaction with other lighting and volumetric settings in the engine.
Regarding the associated variable CVarHeterogeneousVolumesIndirectLighting:
The purpose of CVarHeterogeneousVolumesIndirectLighting is to provide a C++ interface for the r.HeterogeneousVolumes.IndirectLighting console variable within the engine’s code.
This variable is used directly in the HeterogeneousVolumes namespace, specifically in the UseIndirectLighting() function. This function likely determines whether indirect lighting calculations should be performed for heterogeneous volumes during rendering.
The value of CVarHeterogeneousVolumesIndirectLighting is set automatically by the engine’s console variable system, mirroring the value of r.HeterogeneousVolumes.IndirectLighting.
Developers should be aware that this variable is accessed using the GetValueOnRenderThread() method, ensuring thread-safe access to its current value.
Best practices when using CVarHeterogeneousVolumesIndirectLighting include:
- Always accessing it through the provided GetValueOnRenderThread() method to ensure thread safety.
- Avoiding direct modification of this variable; instead, modify the corresponding console variable r.HeterogeneousVolumes.IndirectLighting.
- Being mindful of potential performance impacts when enabling indirect lighting for heterogeneous volumes.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:65
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesIndirectLighting(
TEXT("r.HeterogeneousVolumes.IndirectLighting"),
0,
TEXT("Enables indirect lighting (Default = 0)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesJitter(
#Associated Variable and Callsites
This variable is associated with another variable named CVarHeterogeneousVolumesIndirectLighting
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:64
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesIndirectLighting(
TEXT("r.HeterogeneousVolumes.IndirectLighting"),
0,
TEXT("Enables indirect lighting (Default = 0)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:483
Scope (from outer to inner):
file
namespace HeterogeneousVolumes
function bool UseIndirectLighting
Source code excerpt:
bool UseIndirectLighting()
{
return CVarHeterogeneousVolumesIndirectLighting.GetValueOnRenderThread() != 0;
}
bool ShouldApplyHeightFog()
{
return CVarHeterogeneousVolumesApplyHeightFog.GetValueOnRenderThread() != 0;
}