r.LumenScene.Radiosity

r.LumenScene.Radiosity

#Overview

name: r.LumenScene.Radiosity

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 is to control the enablement of Radiosity in the Lumen lighting system. Radiosity is an indirect lighting gather from the Surface Cache that provides multibounce diffuse lighting.

This setting variable is primarily used in the Lumen rendering system, which is part of Unreal Engine’s advanced global illumination solution. It’s specifically utilized in the Radiosity component of Lumen.

The value of this variable is set through the console variable system in Unreal Engine. It’s defined as an FAutoConsoleVariableRef, which allows it to be changed at runtime through console commands or configuration files.

The associated variable GLumenRadiosity directly interacts with r.LumenScene.Radiosity. They share the same value, with GLumenRadiosity being the actual integer variable used in the code to check if Radiosity is enabled.

Developers should be aware that this variable affects the quality and performance of global illumination in their scenes. Enabling Radiosity (by setting the value to 1) will provide more accurate indirect lighting but may have performance implications.

Best practices when using this variable include:

  1. Only enable it when higher quality indirect lighting is required, as it can impact performance.
  2. Test scenes with and without Radiosity to balance visual quality and performance.
  3. Consider exposing this setting to end-users for scalability options in the final product.

Regarding the associated variable GLumenRadiosity:

The purpose of GLumenRadiosity is to serve as the actual integer flag that determines whether Lumen’s Radiosity feature is enabled or disabled in the rendering code.

This variable is used within the Lumen rendering system, specifically in the Radiosity calculations.

The value of GLumenRadiosity is set through the r.LumenScene.Radiosity console variable.

It directly interacts with the r.LumenScene.Radiosity console variable, sharing the same value.

Developers should be aware that checking GLumenRadiosity in the code will determine if Radiosity calculations are performed.

Best practices for using GLumenRadiosity include:

  1. Use it in conditional statements to enable or disable Radiosity-related code paths.
  2. Avoid modifying it directly; instead, use the r.LumenScene.Radiosity console variable to change its value.
  3. Consider the performance implications when Radiosity is enabled (GLumenRadiosity != 0) in performance-critical code sections.

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

Scope: file

Source code excerpt:

int32 GLumenRadiosity = 1;
FAutoConsoleVariableRef CVarLumenRadiosity(
	TEXT("r.LumenScene.Radiosity"),
	GLumenRadiosity,
	TEXT("Whether to enable the Radiosity, which is an indirect lighting gather from the Surface Cache that provides multibounce diffuse."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GLumenRadiosityProbeSpacing = 4;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

#include "BlueNoise.h"

int32 GLumenRadiosity = 1;
FAutoConsoleVariableRef CVarLumenRadiosity(
	TEXT("r.LumenScene.Radiosity"),
	GLumenRadiosity,
	TEXT("Whether to enable the Radiosity, which is an indirect lighting gather from the Surface Cache that provides multibounce diffuse."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GLumenRadiosityProbeSpacing = 4;
FAutoConsoleVariableRef CVarLumenRadiosityProbeSpacing(

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

Scope (from outer to inner):

file
function     bool LumenRadiosity::IsEnabled

Source code excerpt:

bool LumenRadiosity::IsEnabled(const FSceneViewFamily& ViewFamily)
{
	return GLumenRadiosity != 0
		&& ViewFamily.EngineShowFlags.LumenSecondaryBounces;
}

bool Lumen::UseHardwareRayTracedRadiosity(const FSceneViewFamily& ViewFamily)
{
#if RHI_RAYTRACING