r.LumenScene.Radiosity.VisualizeProbes

r.LumenScene.Radiosity.VisualizeProbes

#Overview

name: r.LumenScene.Radiosity.VisualizeProbes

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.VisualizeProbes is to control the visualization of radiosity probes in the Lumen scene rendering system. This setting variable is part of Unreal Engine 5’s Lumen global illumination system, specifically for the radiosity component.

This setting variable is primarily used in the Lumen radiosity subsystem within the Renderer module of Unreal Engine 5. Based on the callsites, it’s clear that this variable is utilized in the LumenRadiosity.cpp file, which is responsible for handling radiosity calculations and visualizations in the Lumen lighting system.

The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with an initial value of 0, meaning the visualization is off by default. Developers can change this value at runtime through console commands or project settings.

The associated variable CVarLumenSceneRadiosityVisualizeProbes directly interacts with this setting. They share the same value and purpose, with CVarLumenSceneRadiosityVisualizeProbes being the actual console variable used in the C++ code.

Developers must be aware that enabling this variable (setting it to a non-zero value) will cause the engine to visualize radiosity probes, which may impact performance and change the visual output of the scene. This visualization is likely intended for debugging and development purposes rather than for use in a shipping game.

Best practices when using this variable include:

  1. Only enable it when needed for debugging or visual inspection of radiosity probes.
  2. Be mindful of potential performance impacts when enabled.
  3. Remember to disable it before shipping the game or when it’s not needed for development.

Regarding the associated variable CVarLumenSceneRadiosityVisualizeProbes:

The purpose of CVarLumenSceneRadiosityVisualizeProbes is identical to r.LumenScene.Radiosity.VisualizeProbes. It’s the actual console variable implementation used in the C++ code to control the visualization of radiosity probes.

This variable is used directly in the Lumen radiosity system within the Renderer module. It’s checked in the render thread to determine whether to visualize the radiosity probes.

The value is set when the console variable is initialized, and can be changed at runtime through console commands or engine settings.

As mentioned earlier, it directly corresponds to the r.LumenScene.Radiosity.VisualizeProbes setting.

Developers should be aware that this variable is checked on the render thread, so changing its value will have an immediate effect on the rendering pipeline.

Best practices for using CVarLumenSceneRadiosityVisualizeProbes are the same as for r.LumenScene.Radiosity.VisualizeProbes, focusing on using it judiciously for debugging and development purposes, and ensuring it’s disabled when not needed.

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

Scope: file

Source code excerpt:


TAutoConsoleVariable<int32> CVarLumenSceneRadiosityVisualizeProbes(
	TEXT("r.LumenScene.Radiosity.VisualizeProbes"),
	0,
	TEXT("Whether to visualize radiosity probes."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

TAutoConsoleVariable<int32> CVarLumenSceneRadiosityVisualizeProbeRadius(

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

TAutoConsoleVariable<int32> CVarLumenSceneRadiosityVisualizeProbes(
	TEXT("r.LumenScene.Radiosity.VisualizeProbes"),
	0,
	TEXT("Whether to visualize radiosity probes."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

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

Scope: file

Source code excerpt:

		&& LumenSceneData.RadiosityProbeSHGreenAtlas
		&& LumenSceneData.RadiosityProbeSHBlueAtlas
		&& CVarLumenSceneRadiosityVisualizeProbes.GetValueOnRenderThread() != 0)
	{
		RDG_EVENT_SCOPE(GraphBuilder, "VisualizeLumenRadiosityProbes");

		FRDGTextureRef SceneColor = SceneTextures.Color.Resolve;
		FRDGTextureRef SceneDepth = SceneTextures.Depth.Resolve;