r.HeterogeneousVolumes.FrustumGrid.MaxBottomLevelMemoryInMegabytes
r.HeterogeneousVolumes.FrustumGrid.MaxBottomLevelMemoryInMegabytes
#Overview
name: r.HeterogeneousVolumes.FrustumGrid.MaxBottomLevelMemoryInMegabytes
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The minimum voxel size (Default = 128)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HeterogeneousVolumes.FrustumGrid.MaxBottomLevelMemoryInMegabytes is to control the maximum memory allocation for the bottom level of the frustum grid in the Heterogeneous Volumes system. This setting is part of Unreal Engine 5’s rendering system, specifically for managing volumetric rendering.
This setting variable is primarily used in the Renderer module, specifically within the Heterogeneous Volumes subsystem. It’s referenced in the HeterogeneousVolumesVoxelGridPipeline.cpp file, which suggests it’s crucial for the voxel grid pipeline in heterogeneous volume rendering.
The value of this variable is set as a console variable with a default value of 128 megabytes. It can be modified at runtime through the console or configuration files.
This variable interacts with its associated C++ variable CVarHeterogeneousVolumesFrustumGridMaxBottomLevelMemoryInMegabytes. The C++ variable is used to retrieve the current value of the setting in the GetMaxBottomLevelMemoryInMegabytesForFrustumGrid() function.
Developers should be aware that this variable directly impacts memory usage for volumetric rendering. Setting it too high might lead to excessive memory consumption, while setting it too low could potentially reduce the quality or precision of the volumetric rendering.
Best practices when using this variable include:
- Adjusting it based on the target hardware capabilities.
- Balancing it with other memory-intensive rendering features.
- Profiling the application to ensure optimal performance and memory usage.
- Considering the complexity and size of the volumetric effects in your scene when setting this value.
Regarding the associated variable CVarHeterogeneousVolumesFrustumGridMaxBottomLevelMemoryInMegabytes:
This C++ variable is the internal representation of the r.HeterogeneousVolumes.FrustumGrid.MaxBottomLevelMemoryInMegabytes console variable. It’s defined as a TAutoConsoleVariable
The purpose of this associated variable is to provide a programmatic way to access and modify the setting within the C++ code. It’s used in the GetMaxBottomLevelMemoryInMegabytesForFrustumGrid() function to retrieve the current value, ensuring that it’s at least 1 megabyte.
Developers should be aware that changes to this variable will directly affect the r.HeterogeneousVolumes.FrustumGrid.MaxBottomLevelMemoryInMegabytes setting. When accessing this variable in code, it’s important to use the GetValueOnRenderThread() method to ensure thread-safe access in render thread contexts.
Best practices for using this associated variable include:
- Always accessing it through the appropriate thread-safe methods.
- Considering caching the value if it’s accessed frequently, to avoid potential performance impacts from repeated console variable lookups.
- Being cautious when modifying this value programmatically, as it could have significant impacts on memory usage and rendering performance.
#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:52
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesFrustumGridMaxBottomLevelMemoryInMegabytes(
TEXT("r.HeterogeneousVolumes.FrustumGrid.MaxBottomLevelMemoryInMegabytes"),
128,
TEXT("The minimum voxel size (Default = 128)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesEnableOrthoVoxelGrid(
#Associated Variable and Callsites
This variable is associated with another variable named CVarHeterogeneousVolumesFrustumGridMaxBottomLevelMemoryInMegabytes
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:51
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesFrustumGridMaxBottomLevelMemoryInMegabytes(
TEXT("r.HeterogeneousVolumes.FrustumGrid.MaxBottomLevelMemoryInMegabytes"),
128,
TEXT("The minimum voxel size (Default = 128)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:312
Scope (from outer to inner):
file
namespace HeterogeneousVolumes
function int32 GetMaxBottomLevelMemoryInMegabytesForFrustumGrid
Source code excerpt:
int32 GetMaxBottomLevelMemoryInMegabytesForFrustumGrid()
{
return FMath::Max(CVarHeterogeneousVolumesFrustumGridMaxBottomLevelMemoryInMegabytes.GetValueOnRenderThread(), 1);
}
bool EnableOrthoVoxelGrid()
{
return CVarHeterogeneousVolumesEnableOrthoVoxelGrid.GetValueOnRenderThread() != 0;
}