r.LumenScene.Radiosity.ProbeOcclusion

r.LumenScene.Radiosity.ProbeOcclusion

#Overview

name: r.LumenScene.Radiosity.ProbeOcclusion

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.LumenScene.Radiosity.ProbeOcclusion is to control depth testing against probe hit depths during interpolation and filtering in the Lumen radiosity system. This setting is used to reduce light leaking in the global illumination calculation.

This setting variable is primarily used in the Lumen radiosity subsystem, which is part of Unreal Engine 5’s global illumination solution. It’s specifically utilized in the rendering module, as evidenced by its location in the LumenRadiosity.cpp file.

The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 1 (enabled) and can be changed at runtime using console commands or through project settings.

The variable interacts closely with another variable named GRadiosityFilteringProbeOcclusionStrength, which controls the strength of the probe occlusion effect. Together, these variables determine if and how strongly the probe occlusion is applied in the radiosity calculations.

Developers should be aware that this feature is not available when using Software Ray Tracing due to precision limitations. It’s only effective when hardware ray tracing is enabled.

Best practices for using this variable include:

  1. Enabling it (set to 1) when using hardware ray tracing to reduce light leaking.
  2. Disabling it (set to 0) when using software ray tracing to avoid potential artifacts.
  3. Adjusting the GRadiosityFilteringProbeOcclusionStrength in conjunction with this setting to fine-tune the effect.
  4. Testing the visual impact and performance implications in various lighting scenarios.

Regarding the associated variable GRadiosityFilteringProbeOcclusion:

This is an internal integer variable that directly corresponds to the r.LumenScene.Radiosity.ProbeOcclusion console variable. Its purpose is to store the actual value of the setting within the engine’s code.

The variable is used in the Lumen radiosity system to determine whether to apply probe occlusion. It’s checked in the radiosity filtering process to enable or disable the feature.

The value of GRadiosityFilteringProbeOcclusion is set by the console variable system when r.LumenScene.Radiosity.ProbeOcclusion is modified.

It interacts with GRadiosityFilteringProbeOcclusionStrength to determine if probe occlusion should be applied. Both conditions (GRadiosityFilteringProbeOcclusion != 0 and GRadiosityFilteringProbeOcclusionStrength > 0.0f) must be true for the feature to be active.

Developers should be aware that this variable is used in conditional statements to enable or disable probe occlusion functionality in the radiosity calculations.

Best practices include ensuring consistency between this internal variable and the console variable, and considering its value when debugging or optimizing the Lumen radiosity system.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:65

Scope: file

Source code excerpt:

int32 GRadiosityFilteringProbeOcclusion = 1;
FAutoConsoleVariableRef CVarRadiosityFilteringProbeOcclusion(
	TEXT("r.LumenScene.Radiosity.ProbeOcclusion"),
	GRadiosityFilteringProbeOcclusion,
	TEXT("Whether to depth test against the probe hit depths during interpolation and filtering to reduce leaking.  Not available with Software Ray Tracing due to imprecision."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

float GRadiosityFilteringProbeOcclusionStrength = .5f;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:63

Scope: file

Source code excerpt:

);

int32 GRadiosityFilteringProbeOcclusion = 1;
FAutoConsoleVariableRef CVarRadiosityFilteringProbeOcclusion(
	TEXT("r.LumenScene.Radiosity.ProbeOcclusion"),
	GRadiosityFilteringProbeOcclusion,
	TEXT("Whether to depth test against the probe hit depths during interpolation and filtering to reduce leaking.  Not available with Software Ray Tracing due to imprecision."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

float GRadiosityFilteringProbeOcclusionStrength = .5f;
FAutoConsoleVariableRef CVarRadiosityFilteringProbeOcclusionStrength(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:600

Scope: file

Source code excerpt:

			RadiosityFrameTemporaries.bIndirectLightingHistoryValid);

		RadiosityFrameTemporaries.bUseProbeOcclusion = GRadiosityFilteringProbeOcclusion != 0
			&& GRadiosityFilteringProbeOcclusionStrength > 0.0f
			// Self intersection from grazing angle traces causes noise that breaks probe occlusion
			&& Lumen::UseHardwareRayTracedRadiosity(*FirstView.Family);

		if (RadiosityFrameTemporaries.bUseProbeOcclusion)
		{