r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.Resolution

r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.Resolution

#Overview

name: r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.Resolution

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.Tessellation.BottomLevelGrid.Resolution is to determine the intra-tile bottom-level grid resolution for heterogeneous volumes in Unreal Engine’s rendering system. This setting is specifically related to the tessellation of heterogeneous volumes, which are likely used in advanced rendering techniques for volumetric effects or complex 3D structures.

This setting variable is primarily used in the Renderer module of Unreal Engine, specifically within the HeterogeneousVolumes subsystem. Based on the code references, it’s part of the voxel grid pipeline for heterogeneous volumes.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 4, but can be changed at runtime through console commands or configuration files.

The associated variable CVarHeterogeneousVolumesBottomLevelGridResolution directly interacts with this setting. It’s an instance of TAutoConsoleVariable that holds the actual value and provides thread-safe access to it.

Developers should be aware that:

  1. The value is clamped between 1 and 4 when used in the GetBottomLevelGridResolution() function.
  2. Changes to this value will affect the rendering performance and quality of heterogeneous volumes.
  3. This setting is marked as render thread safe (ECVF_RenderThreadSafe), meaning it can be safely accessed and modified from the render thread.

Best practices when using this variable include:

  1. Carefully consider the performance implications when adjusting this value, as higher resolutions may impact rendering performance.
  2. Test different values to find the optimal balance between visual quality and performance for your specific use case.
  3. Use the GetBottomLevelGridResolution() function to access the value, as it ensures the value is properly clamped.

Regarding the associated variable CVarHeterogeneousVolumesBottomLevelGridResolution:

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

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesBottomLevelGridResolution(
	TEXT("r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.Resolution"),
	4,
	TEXT("Determines intra-tile bottom-level grid resolution (Default = 4)"),
	ECVF_RenderThreadSafe
);

static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesBottomLevelGridVoxelHashing(

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesBottomLevelGridResolution(
	TEXT("r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.Resolution"),
	4,
	TEXT("Determines intra-tile bottom-level grid resolution (Default = 4)"),
	ECVF_RenderThreadSafe
);

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

Scope (from outer to inner):

file
namespace    HeterogeneousVolumes
function     int32 GetBottomLevelGridResolution

Source code excerpt:

	int32 GetBottomLevelGridResolution()
	{
		return FMath::Clamp(CVarHeterogeneousVolumesBottomLevelGridResolution.GetValueOnRenderThread(), 1, 4);
	}

	int32 GetIndirectionGridResolution()
	{
		return FMath::Clamp(CVarHeterogeneousVolumesIndirectionGridResolution.GetValueOnRenderThread(), 1, 4);
	}