r.HeterogeneousVolumes
r.HeterogeneousVolumes
#Overview
name: r.HeterogeneousVolumes
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables the Heterogeneous volume integrator (Default = 1)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HeterogeneousVolumes is to enable or disable the Heterogeneous volume integrator in Unreal Engine’s rendering system. This setting variable is primarily used for controlling advanced volumetric rendering features.
Based on the details in the Callsites section, this setting variable is relied upon by the Renderer module, specifically within the HeterogeneousVolumes subsystem.
The value of this variable is set through a console variable (CVar) system, with a default value of 1 (enabled). It can be changed at runtime using console commands or through configuration files.
The associated variable CVarHeterogeneousVolumes interacts directly with r.HeterogeneousVolumes. They share the same value and purpose.
Developers must be aware that this variable affects the render thread, as indicated by the ECVF_RenderThreadSafe flag. Changes to this variable will impact rendering performance and visual quality, particularly in scenes with complex volumetric effects.
Best practices when using this variable include:
- Only disable it if you’re experiencing performance issues related to volumetric rendering.
- Test thoroughly after changing its value, as it may significantly impact the visual quality of your scenes.
- Consider exposing this setting to end-users for performance optimization options.
Regarding the associated variable CVarHeterogeneousVolumes:
The purpose of CVarHeterogeneousVolumes is to provide programmatic access to the r.HeterogeneousVolumes setting within the C++ code.
This variable is used within the Renderer module, specifically in the HeterogeneousVolumes subsystem.
Its value is set through the TAutoConsoleVariable template, which links it to the r.HeterogeneousVolumes console variable.
CVarHeterogeneousVolumes interacts directly with r.HeterogeneousVolumes, serving as its in-code representation.
Developers should be aware that this variable is accessed on the render thread, as seen in the IsHeterogeneousVolumesEnabled() function.
Best practices for using CVarHeterogeneousVolumes include:
- Always access its value using the provided GetValueOnRenderThread() method to ensure thread safety.
- Use the IsHeterogeneousVolumesEnabled() function for cleaner code when checking if the feature is enabled.
- Avoid directly modifying this variable; instead, use the console variable system to change its value.
#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:12
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumes(
TEXT("r.HeterogeneousVolumes"),
1,
TEXT("Enables the Heterogeneous volume integrator (Default = 1)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesShadows(
#Associated Variable and Callsites
This variable is associated with another variable named CVarHeterogeneousVolumes
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:11
Scope: file
Source code excerpt:
#include "SceneManagement.h"
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumes(
TEXT("r.HeterogeneousVolumes"),
1,
TEXT("Enables the Heterogeneous volume integrator (Default = 1)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:267
Scope (from outer to inner):
file
function static bool IsHeterogeneousVolumesEnabled
Source code excerpt:
static bool IsHeterogeneousVolumesEnabled()
{
return CVarHeterogeneousVolumes.GetValueOnRenderThread() != 0;
}
bool ShouldHeterogeneousVolumesCastShadows()
{
return CVarHeterogeneousVolumesShadows.GetValueOnAnyThread() != 0;
}