r.HeterogeneousVolumes.Tessellation.MinimumVoxelSizeInFrustum
r.HeterogeneousVolumes.Tessellation.MinimumVoxelSizeInFrustum
#Overview
name: r.HeterogeneousVolumes.Tessellation.MinimumVoxelSizeInFrustum
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The minimum voxel size (Default = 1.0)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HeterogeneousVolumes.Tessellation.MinimumVoxelSizeInFrustum is to control the minimum voxel size for heterogeneous volumes within the camera frustum in Unreal Engine’s rendering system. This setting variable is primarily used in the rendering subsystem, specifically for managing the tessellation of heterogeneous volumes.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the HeterogeneousVolumes component. This can be inferred from the file path where the variable is defined: Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp.
The value of this variable is set using a TAutoConsoleVariable, which allows it to be modified at runtime through console commands. The default value is set to 1.0.
This variable interacts with another variable named CVarHeterogeneousVolumesMinimumVoxelSizeInFrustum, which is the associated C++ variable that holds the same value. The GetMinimumVoxelSizeInFrustum() function uses this variable to retrieve the current value, ensuring it’s not less than 0.01.
Developers must be aware that this variable affects the tessellation quality of heterogeneous volumes within the camera’s view frustum. A smaller value will result in finer tessellation but may impact performance, while a larger value will reduce tessellation detail but potentially improve performance.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your scene and target hardware.
- Balancing between visual quality and performance.
- Testing different values to find the optimal setting for your project.
- Considering the relationship with other heterogeneous volume settings.
Regarding the associated variable CVarHeterogeneousVolumesMinimumVoxelSizeInFrustum:
The purpose of this variable is to provide a C++ interface for accessing and modifying the r.HeterogeneousVolumes.Tessellation.MinimumVoxelSizeInFrustum setting within the engine’s code.
This variable is used directly in the Renderer module, specifically in the HeterogeneousVolumes component.
The value of this variable is set through the TAutoConsoleVariable declaration, which links it to the console variable r.HeterogeneousVolumes.Tessellation.MinimumVoxelSizeInFrustum.
It interacts with the GetMinimumVoxelSizeInFrustum() function, which retrieves its value and ensures it’s not below a minimum threshold.
Developers should be aware that modifying this variable directly in C++ code will affect the engine’s rendering behavior for heterogeneous volumes.
Best practices for using this variable in C++ code include:
- Using the GetValueOnRenderThread() method to access its value safely.
- Avoiding direct modification of the variable, instead using console commands to change its value.
- Considering thread safety when accessing or modifying the variable, as it’s marked with ECVF_RenderThreadSafe.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:121
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarHeterogeneousVolumesMinimumVoxelSizeInFrustum(
TEXT("r.HeterogeneousVolumes.Tessellation.MinimumVoxelSizeInFrustum"),
1.0,
TEXT("The minimum voxel size (Default = 1.0)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<float> CVarHeterogeneousVolumesMinimumVoxelSizeOutsideFrustum(
#Associated Variable and Callsites
This variable is associated with another variable named CVarHeterogeneousVolumesMinimumVoxelSizeInFrustum
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:120
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<float> CVarHeterogeneousVolumesMinimumVoxelSizeInFrustum(
TEXT("r.HeterogeneousVolumes.Tessellation.MinimumVoxelSizeInFrustum"),
1.0,
TEXT("The minimum voxel size (Default = 1.0)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:337
Scope (from outer to inner):
file
namespace HeterogeneousVolumes
function float GetMinimumVoxelSizeInFrustum
Source code excerpt:
float GetMinimumVoxelSizeInFrustum()
{
return FMath::Max(CVarHeterogeneousVolumesMinimumVoxelSizeInFrustum.GetValueOnRenderThread(), 0.01);
}
float GetMinimumVoxelSizeOutsideFrustum()
{
return FMath::Max(CVarHeterogeneousVolumesMinimumVoxelSizeOutsideFrustum.GetValueOnRenderThread(), 0.01);
}