r.HeterogeneousVolumes.CLOD.Bias

r.HeterogeneousVolumes.CLOD.Bias

#Overview

name: r.HeterogeneousVolumes.CLOD.Bias

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.CLOD.Bias is to control the Continuous Level-of-Detail (CLOD) computation for heterogeneous volumes in the rendering system. It allows developers to bias the evaluation result, affecting the level of detail in the rendered volumes.

This setting variable is used in the Renderer module of Unreal Engine, specifically within the HeterogeneousVolumes subsystem. It’s part of the rendering pipeline that handles volumetric rendering.

The value of this variable is set through the console variable system in Unreal Engine. It’s defined with a default value of 0.0, but can be modified at runtime or through configuration files.

The associated variable CVarHeterogeneousVolumesCLODBias is directly linked to r.HeterogeneousVolumes.CLOD.Bias. It’s an instance of TAutoConsoleVariable that provides the interface for getting and setting the CLOD bias value.

Developers should be aware that:

  1. Positive values will result in coarser detail.
  2. Negative values will result in sharper detail.
  3. The variable is render thread safe, meaning it can be safely accessed and modified from the render thread.

Best practices when using this variable include:

  1. Use it to fine-tune the balance between performance and visual quality in volumetric rendering.
  2. Be cautious when setting extreme values, as they may significantly impact either performance or visual quality.
  3. Test thoroughly with different values to find the optimal setting for your specific use case.

Regarding the associated variable CVarHeterogeneousVolumesCLODBias:

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

Scope: file

Source code excerpt:


static TAutoConsoleVariable<float> CVarHeterogeneousVolumesCLODBias(
	TEXT("r.HeterogeneousVolumes.CLOD.Bias"),
	0.0,
	TEXT("Biases evaluation result when computing Continuous Level-of-Detail (Default = 0.0)\n")
	TEXT("> 0: Coarser\n")
	TEXT("< 0: Sharper\n"),
	ECVF_RenderThreadSafe
);

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<float> CVarHeterogeneousVolumesCLODBias(
	TEXT("r.HeterogeneousVolumes.CLOD.Bias"),
	0.0,
	TEXT("Biases evaluation result when computing Continuous Level-of-Detail (Default = 0.0)\n")
	TEXT("> 0: Coarser\n")
	TEXT("< 0: Sharper\n"),
	ECVF_RenderThreadSafe

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

Scope (from outer to inner):

file
namespace    HeterogeneousVolumes
function     float GetCLODBias

Source code excerpt:

	float GetCLODBias()
	{
		return CVarHeterogeneousVolumesCLODBias.GetValueOnRenderThread();
	}

	// Convenience Utils
	int GetVoxelCount(FIntVector VolumeResolution)
	{
		return VolumeResolution.X * VolumeResolution.Y * VolumeResolution.Z;