r.HeterogeneousVolumes.SparseVoxel.GenerationMipBias

r.HeterogeneousVolumes.SparseVoxel.GenerationMipBias

#Overview

name: r.HeterogeneousVolumes.SparseVoxel.GenerationMipBias

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.SparseVoxel.GenerationMipBias is to determine the MIP (Mipmap) bias for sparse voxel generation in heterogeneous volumes rendering. This setting variable is primarily used in the rendering system, specifically for the heterogeneous volumes feature in Unreal Engine 5.

The Unreal Engine subsystem that relies on this setting variable is the Renderer module, as evidenced by its location in the HeterogeneousVolumes.cpp file within the Renderer’s private directory.

The value of this variable is set as a console variable with a default value of 3. It can be modified at runtime through the console or programmatically.

This variable interacts with its associated variable CVarHeterogeneousVolumesSparseVoxelGenerationMipBias. They share the same value and purpose.

Developers must be aware that this variable affects the level of detail in sparse voxel generation. A higher value will result in using lower resolution mipmaps, which can improve performance at the cost of visual quality. Conversely, a lower value will use higher resolution mipmaps, potentially increasing visual quality but at a higher performance cost.

Best practices when using this variable include:

  1. Adjusting it based on the specific needs of your project, balancing between performance and visual quality.
  2. Testing different values to find the optimal setting for your specific use case.
  3. Considering the target hardware capabilities when setting this value.
  4. Using it in conjunction with other heterogeneous volumes settings for best results.

Regarding the associated variable CVarHeterogeneousVolumesSparseVoxelGenerationMipBias:

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

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

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesSparseVoxelGenerationMipBias(
	TEXT("r.HeterogeneousVolumes.SparseVoxel.GenerationMipBias"),
	3,
	TEXT("Determines MIP bias for sparse voxel generation (Default = 3)"),
	ECVF_RenderThreadSafe
);

static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesSparseVoxelPerTileCulling(

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesSparseVoxelGenerationMipBias(
	TEXT("r.HeterogeneousVolumes.SparseVoxel.GenerationMipBias"),
	3,
	TEXT("Determines MIP bias for sparse voxel generation (Default = 3)"),
	ECVF_RenderThreadSafe
);

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

Scope (from outer to inner):

file
namespace    HeterogeneousVolumes
function     uint32 GetSparseVoxelMipBias

Source code excerpt:

	{
		// TODO: Clamp based on texture dimension..
		return FMath::Clamp(CVarHeterogeneousVolumesSparseVoxelGenerationMipBias.GetValueOnRenderThread(), 0, 10);
	}

	int32 GetDebugMode()
	{
		return CVarHeterogeneousVolumesDebug.GetValueOnRenderThread();
	}