r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.VoxelHashing

r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.VoxelHashing

#Overview

name: r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.VoxelHashing

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.VoxelHashing is to enable bottom-level voxel hashing for deduplication in the heterogeneous volumes rendering system. This setting is part of Unreal Engine 5’s volumetric rendering capabilities, specifically for optimizing the rendering of complex, heterogeneous volumes.

This setting variable is primarily used in the Renderer module of Unreal Engine, specifically within the HeterogeneousVolumes subsystem. It’s defined and used in the HeterogeneousVolumesVoxelGridPipeline.cpp file, which suggests it’s closely tied to the voxel grid pipeline for heterogeneous volume rendering.

The value of this variable is set using a console variable (CVar) system. It’s initialized with a default value of 0, meaning the feature is disabled by default. Developers can change this value at runtime using console commands or through configuration files.

This variable interacts with an associated variable named CVarHeterogeneousVolumesBottomLevelGridVoxelHashing. They share the same value and purpose, with the CVar being the actual implementation used in the code.

Developers should be aware that enabling this feature (by setting the value to non-zero) will activate bottom-level voxel hashing for deduplication. This can potentially improve rendering performance and memory usage for complex volumetric scenes, but may also introduce some computational overhead.

Best practices when using this variable include:

  1. Testing the performance impact in your specific use case before enabling it in production.
  2. Considering the trade-off between potential memory savings and computational cost.
  3. Using it in conjunction with other heterogeneous volume rendering settings for optimal results.

Regarding the associated variable CVarHeterogeneousVolumesBottomLevelGridVoxelHashing:

The purpose of CVarHeterogeneousVolumesBottomLevelGridVoxelHashing is the same as r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.VoxelHashing. It’s the actual console variable implementation used in the code to control the bottom-level voxel hashing feature.

This variable is defined and used in the Renderer module, specifically within the HeterogeneousVolumes namespace. It’s used to determine whether voxel hashing should be enabled through the EnableVoxelHashing() function.

The value of this variable is set through the console variable system, initialized with a default value of 0. It can be changed at runtime using console commands or through configuration files.

Developers should be aware that the EnableVoxelHashing() function, which uses this variable, is currently commented out and always returns false. This suggests that the feature might be disabled or under development in the current version of the engine.

Best practices for using this variable include:

  1. Checking the current implementation status before relying on it in your project.
  2. If the feature becomes active, testing its impact on performance and memory usage in your specific use cases.
  3. Considering it as part of a broader strategy for optimizing heterogeneous volume rendering in your game or application.

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

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesBottomLevelGridVoxelHashing(
	TEXT("r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.VoxelHashing"),
	0,
	TEXT("Enables bottom-level voxel hashing for deduplication (Default = 0)\n"),
	ECVF_RenderThreadSafe
);

static TAutoConsoleVariable<float> CVarHeterogeneousVolumesMinimumVoxelSizeInFrustum(

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesBottomLevelGridVoxelHashing(
	TEXT("r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.VoxelHashing"),
	0,
	TEXT("Enables bottom-level voxel hashing for deduplication (Default = 0)\n"),
	ECVF_RenderThreadSafe
);

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

Scope (from outer to inner):

file
namespace    HeterogeneousVolumes
function     bool EnableVoxelHashing

Source code excerpt:

	bool EnableVoxelHashing()
	{
		//return CVarHeterogeneousVolumesBottomLevelGridVoxelHashing.GetValueOnRenderThread() != 0;
		return false;
	}

	uint32 GetVoxelHashingMemoryInMegabytes()
	{
		return CVarHeterogeneousVolumesBottomLevelGridVoxelHashingMemoryInMegabytes.GetValueOnRenderThread();