r.Lumen.TranslucencyVolume.RadianceCache.NumMipmaps

r.Lumen.TranslucencyVolume.RadianceCache.NumMipmaps

#Overview

name: r.Lumen.TranslucencyVolume.RadianceCache.NumMipmaps

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.Lumen.TranslucencyVolume.RadianceCache.NumMipmaps is to control the number of radiance cache mipmaps used in Lumen’s translucency volume lighting system. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically for handling lighting in translucent volumes.

This setting variable is primarily used in the Renderer module of Unreal Engine 5, specifically within the Lumen subsystem. The code references are found in the LumenTranslucencyVolumeLighting.cpp file, which suggests it’s closely tied to the translucency volume lighting calculations in Lumen.

The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 3 and can be modified at runtime using the console command system.

The associated variable GTranslucencyVolumeRadianceCacheNumMipmaps directly interacts with this console variable. They share the same value, with GTranslucencyVolumeRadianceCacheNumMipmaps being the actual variable used in the code to determine the number of mipmaps.

Developers should be aware that changing this value affects the detail and performance of the translucency volume lighting. Increasing the number of mipmaps can potentially improve lighting quality for translucent objects at different distances but may also increase memory usage and computational cost.

Best practices when using this variable include:

  1. Carefully balancing visual quality and performance requirements.
  2. Testing different values to find the optimal setting for your specific scene.
  3. Considering the impact on memory usage, especially on platforms with limited resources.
  4. Coordinating changes with other Lumen settings for consistent results.

Regarding the associated variable GTranslucencyVolumeRadianceCacheNumMipmaps:

The purpose of GTranslucencyVolumeRadianceCacheNumMipmaps is to store and provide the actual value for the number of radiance cache mipmaps within the engine’s C++ code.

This variable is used directly in the Lumen translucency volume lighting system, specifically in the LumenTranslucencyVolumeRadianceCache namespace.

Its value is set by the console variable system through r.Lumen.TranslucencyVolume.RadianceCache.NumMipmaps.

It interacts directly with the console variable and is used in functions like GetNumMipmaps() to determine the mipmap count for calculations.

Developers should be aware that this is the actual variable used in the rendering code, and any runtime changes to the console variable will be reflected here.

Best practices include using this variable for read-only purposes in most cases, relying on the console variable system for modifications, and considering its impact on related calculations like GetFinalProbeResolution().

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyVolumeLighting.cpp:156

Scope: file

Source code excerpt:

int32 GTranslucencyVolumeRadianceCacheNumMipmaps = 3;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheNumMipmaps(
	TEXT("r.Lumen.TranslucencyVolume.RadianceCache.NumMipmaps"),
	GTranslucencyVolumeRadianceCacheNumMipmaps,
	TEXT("Number of radiance cache mipmaps."),
	ECVF_RenderThreadSafe
);

float GLumenTranslucencyVolumeRadianceCacheClipmapWorldExtent = 2500.0f;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	);

int32 GTranslucencyVolumeRadianceCacheNumMipmaps = 3;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheNumMipmaps(
	TEXT("r.Lumen.TranslucencyVolume.RadianceCache.NumMipmaps"),
	GTranslucencyVolumeRadianceCacheNumMipmaps,
	TEXT("Number of radiance cache mipmaps."),
	ECVF_RenderThreadSafe
);

float GLumenTranslucencyVolumeRadianceCacheClipmapWorldExtent = 2500.0f;
FAutoConsoleVariableRef CVarLumenTranslucencyVolumeRadianceCacheClipmapWorldExtent(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyVolumeLighting.cpp:293

Scope (from outer to inner):

file
namespace    LumenTranslucencyVolumeRadianceCache
function     int32 GetNumMipmaps

Source code excerpt:

	int32 GetNumMipmaps()
	{
		return GTranslucencyVolumeRadianceCacheNumMipmaps;
	}

	int32 GetFinalProbeResolution()
	{
		return GetProbeResolution() + 2 * (1 << (GetNumMipmaps() - 1));
	}