r.HeterogeneousVolumes.OrthoGrid.MaxBottomLevelMemoryInMegabytes

r.HeterogeneousVolumes.OrthoGrid.MaxBottomLevelMemoryInMegabytes

#Overview

name: r.HeterogeneousVolumes.OrthoGrid.MaxBottomLevelMemoryInMegabytes

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.HeterogeneousVolumes.OrthoGrid.MaxBottomLevelMemoryInMegabytes is to control the maximum memory allocation for the bottom level of the orthogonal grid used in the heterogeneous volumes rendering system. It specifically sets the limit in megabytes for the memory used by the lowest level of detail in the grid structure.

This setting variable is primarily used by the Renderer module in Unreal Engine 5, specifically within the heterogeneous volumes rendering subsystem. Based on the callsite information, it’s part of the HeterogeneousVolumesVoxelGridPipeline.

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.

The associated variable CVarHeterogeneousVolumesOrthoGridMaxBottomLevelMemoryInMegabytes directly interacts with this setting. It’s used to retrieve the current value of the setting within the engine’s code.

Developers should be aware that this variable affects the memory usage and potentially the performance of the heterogeneous volumes rendering. Setting it too low might result in reduced quality or rendering artifacts, while setting it too high could lead to excessive memory consumption.

Best practices when using this variable include:

  1. Adjusting it based on the target hardware capabilities and the specific needs of the project.
  2. Monitoring performance and memory usage when modifying this value.
  3. Testing different values to find the optimal balance between visual quality and performance.

Regarding the associated variable CVarHeterogeneousVolumesOrthoGridMaxBottomLevelMemoryInMegabytes:

The purpose of this variable is to provide a programmatic way to access and modify the r.HeterogeneousVolumes.OrthoGrid.MaxBottomLevelMemoryInMegabytes setting within the engine’s C++ code.

It’s used within the Renderer module, specifically in the HeterogeneousVolumes namespace. The GetMaxBottomLevelMemoryInMegabytesForOrthoGrid function uses this variable to retrieve the current setting value.

The value of this variable is set automatically by the engine based on the corresponding console variable setting.

Developers should be aware that this variable is marked as ECVF_RenderThreadSafe, meaning it’s safe to access from the render thread.

Best practices when using this variable include:

  1. Accessing it using the GetValueOnRenderThread() method when in the render thread context.
  2. Avoiding frequent changes to this value during performance-critical operations.
  3. Using it in conjunction with other heterogeneous volumes settings for optimal rendering results.

#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:82

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesOrthoGridMaxBottomLevelMemoryInMegabytes(
	TEXT("r.HeterogeneousVolumes.OrthoGrid.MaxBottomLevelMemoryInMegabytes"),
	128,
	TEXT("The minimum voxel size (Default = 128)"),
	ECVF_RenderThreadSafe
);

static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesMarchingMode(

#Associated Variable and Callsites

This variable is associated with another variable named CVarHeterogeneousVolumesOrthoGridMaxBottomLevelMemoryInMegabytes. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:81

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesOrthoGridMaxBottomLevelMemoryInMegabytes(
	TEXT("r.HeterogeneousVolumes.OrthoGrid.MaxBottomLevelMemoryInMegabytes"),
	128,
	TEXT("The minimum voxel size (Default = 128)"),
	ECVF_RenderThreadSafe
);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:327

Scope (from outer to inner):

file
namespace    HeterogeneousVolumes
function     int32 GetMaxBottomLevelMemoryInMegabytesForOrthoGrid

Source code excerpt:

	int32 GetMaxBottomLevelMemoryInMegabytesForOrthoGrid()
	{
		return FMath::Max(CVarHeterogeneousVolumesOrthoGridMaxBottomLevelMemoryInMegabytes.GetValueOnRenderThread(), 1);
	}

	bool EnableFarPlaneAutoTransition()
	{
		return CVarHeterogeneousVolumesFarPlaneAutoTransition.GetValueOnRenderThread() != 0;
	}