r.Lumen.TranslucencyVolume.MaxRayIntensity

r.Lumen.TranslucencyVolume.MaxRayIntensity

#Overview

name: r.Lumen.TranslucencyVolume.MaxRayIntensity

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.MaxRayIntensity is to control the maximum intensity of rays in the Lumen translucency volume lighting system. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically focusing on the rendering of translucent objects.

This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. Based on the callsites, it’s clear that this variable is utilized in the LumenTranslucencyVolumeLighting.cpp file, which is part of the Renderer’s private implementation.

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

The associated variable GTranslucencyVolumeMaxRayIntensity directly interacts with r.Lumen.TranslucencyVolume.MaxRayIntensity. They share the same value, with GTranslucencyVolumeMaxRayIntensity being the C++ variable used in the engine’s code to access this setting.

Developers should be aware that this variable affects the intensity clamping of light rays in the translucency volume. Setting this value too low might result in underlit translucent objects, while setting it too high could lead to oversaturation or performance issues.

Best practices when using this variable include:

  1. Adjusting it carefully to balance between visual quality and performance.
  2. Testing its impact on various translucent materials in different lighting conditions.
  3. Considering its interaction with other Lumen settings for optimal results.

Regarding the associated variable GTranslucencyVolumeMaxRayIntensity:

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

Scope: file

Source code excerpt:

float GTranslucencyVolumeMaxRayIntensity = 20.0f;
FAutoConsoleVariableRef CVarTranslucencyVolumeMaxRayIntensity(
	TEXT("r.Lumen.TranslucencyVolume.MaxRayIntensity"),
	GTranslucencyVolumeMaxRayIntensity,
	TEXT("."),
	ECVF_Scalability | ECVF_RenderThreadSafe
	);

int32 GLumenTranslucencyVolumeRadianceCache = 1;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	);

float GTranslucencyVolumeMaxRayIntensity = 20.0f;
FAutoConsoleVariableRef CVarTranslucencyVolumeMaxRayIntensity(
	TEXT("r.Lumen.TranslucencyVolume.MaxRayIntensity"),
	GTranslucencyVolumeMaxRayIntensity,
	TEXT("."),
	ECVF_Scalability | ECVF_RenderThreadSafe
	);

int32 GLumenTranslucencyVolumeRadianceCache = 1;
FAutoConsoleVariableRef CVarLumenTranslucencyVolumeRadianceCache(

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

Scope (from outer to inner):

file
function     void FDeferredShadingSceneRenderer::ComputeLumenTranslucencyGIVolume

Source code excerpt:

				TraceSetupParameters.MaxTraceDistance = Lumen::GetMaxTraceDistance(View);
				TraceSetupParameters.VoxelTraceStartDistanceScale = GTranslucencyVolumeVoxelTraceStartDistanceScale;
				TraceSetupParameters.MaxRayIntensity = GTranslucencyVolumeMaxRayIntensity;
			}

			const FIntVector OctahedralAtlasSize(
				TranslucencyGridSize.X * GTranslucencyVolumeTracingOctahedronResolution, 
				TranslucencyGridSize.Y * GTranslucencyVolumeTracingOctahedronResolution,
				TranslucencyGridSize.Z);