r.LocalExposure.VisualizeDebugMode

r.LocalExposure.VisualizeDebugMode

#Overview

name: r.LocalExposure.VisualizeDebugMode

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.LocalExposure.VisualizeDebugMode is to control the visualization mode for local exposure in Unreal Engine 5’s rendering system. This setting variable is specifically used for debugging and visualizing different aspects of the local exposure system.

This setting variable is primarily used in the Renderer module of Unreal Engine, particularly in the post-processing pipeline for local exposure visualization. Based on the callsites, it’s utilized in the file PostProcessVisualizeLocalExposure.cpp, which suggests it’s part of the post-processing visualization 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.

The associated variable CVarLocalExposureVisualizeDebugMode directly interacts with r.LocalExposure.VisualizeDebugMode. They share the same value and are used interchangeably in the code.

Developers must be aware that this variable controls different visualization modes for local exposure: 0: Local Exposure 1: Base Luminance 2: Detail Luminance 3: Valid Bilateral Grid Lookup

When using this variable, developers should consider the following best practices:

  1. Use it primarily for debugging purposes, not in production builds.
  2. Be aware of the different visualization modes and their meanings.
  3. Combine this visualization with other debugging tools to get a comprehensive understanding of the local exposure system.
  4. Remember to disable the visualization when not needed, as it may impact performance.

Regarding the associated variable CVarLocalExposureVisualizeDebugMode:

The purpose of CVarLocalExposureVisualizeDebugMode is identical to r.LocalExposure.VisualizeDebugMode. It’s used internally in the C++ code to access and set the value of the console variable.

This variable is used in the Renderer module, specifically in the post-processing pipeline for local exposure visualization.

The value of CVarLocalExposureVisualizeDebugMode is set and retrieved using the console variable system. It’s accessed in the rendering code using GetValueOnRenderThread() method.

CVarLocalExposureVisualizeDebugMode directly interacts with r.LocalExposure.VisualizeDebugMode, as they represent the same console variable.

Developers should be aware that this variable is used in the rendering thread, so any changes to it should be made with thread safety in mind.

Best practices for using CVarLocalExposureVisualizeDebugMode include:

  1. Use it for reading the current debug mode in rendering code.
  2. Avoid frequent changes during runtime to prevent potential threading issues.
  3. Consider using this variable in conjunction with other local exposure-related variables for comprehensive debugging.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessVisualizeLocalExposure.cpp:8

Scope: file

Source code excerpt:


TAutoConsoleVariable<int> CVarLocalExposureVisualizeDebugMode(
	TEXT("r.LocalExposure.VisualizeDebugMode"),
	0,
	TEXT("When enabling Show->Visualize->Local Exposure is enabled, this flag controls which mode to use.\n")
	TEXT("    0: Local Exposure\n")
	TEXT("    1: Base Luminance\n")
	TEXT("    2: Detail Luminance\n")
	TEXT("    3: Valid Bilateral Grid Lookup\n"),

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessVisualizeLocalExposure.cpp:7

Scope: file

Source code excerpt:

#include "SceneRendering.h"

TAutoConsoleVariable<int> CVarLocalExposureVisualizeDebugMode(
	TEXT("r.LocalExposure.VisualizeDebugMode"),
	0,
	TEXT("When enabling Show->Visualize->Local Exposure is enabled, this flag controls which mode to use.\n")
	TEXT("    0: Local Exposure\n")
	TEXT("    1: Base Luminance\n")
	TEXT("    2: Detail Luminance\n")

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessVisualizeLocalExposure.cpp:85

Scope (from outer to inner):

file
function     FScreenPassTexture AddVisualizeLocalExposurePass

Source code excerpt:

	PassParameters->BlurredLogLum = Inputs.BlurredLumTexture;
	PassParameters->TextureSampler = BilinearClampSampler;
	PassParameters->DebugMode = CVarLocalExposureVisualizeDebugMode.GetValueOnRenderThread();

	TShaderMapRef<FVisualizeLocalExposurePS> PixelShader(View.ShaderMap);

	RDG_EVENT_SCOPE(GraphBuilder, "VisualizeLocalExposure");

	AddDrawScreenPass(GraphBuilder, RDG_EVENT_NAME("Visualizer"), View, OutputViewport, InputViewport, PixelShader, PassParameters);