ShowFlag.VisualizeSkyLightIlluminance

ShowFlag.VisualizeSkyLightIlluminance

#Overview

name: ShowFlag.VisualizeSkyLightIlluminance

This variable is created as a Console Variable (cvar).

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ShowFlag.VisualizeSkyLightIlluminance is to display the illuminance debug view for the skylight in Unreal Engine 5. This setting variable is part of the rendering system, specifically for visualization and debugging purposes.

The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the post-processing pipeline. It is used in conjunction with the SkyLight component to provide visual feedback on the illuminance contribution of the skylight in the scene.

The value of this variable is typically set through the engine show flags, which can be toggled in the editor or via code. In the provided code, it’s being checked as part of the View.Family->EngineShowFlags structure.

This variable interacts with other rendering-related variables and systems, such as:

  1. The Scene’s SkyLight
  2. The View and ViewFamily structures
  3. Other visualization flags like VisualizeHDR

Developers should be aware that:

  1. This visualization is only available in editor builds (#if WITH_EDITOR)
  2. It requires a valid Scene with a SkyLight component
  3. It may interfere with other visualization modes or debug views

Best practices when using this variable include:

  1. Use it for debugging lighting issues related to the skylight
  2. Be aware that enabling this visualization may impact performance
  3. Disable other conflicting visualization modes when using this one
  4. Remember to disable it before final builds or performance testing

The associated variable VisualizeSkyLightIlluminance is used in the same context and serves the same purpose. It’s directly linked to the ShowFlag.VisualizeSkyLightIlluminance and is used to control the visualization of skylight illuminance in the renderer’s post-processing pass sequence.

The purpose of VisualizeSkyLightIlluminance is to enable the rendering pass that visualizes the skylight illuminance. It’s used in the renderer to determine whether to add the illuminance visualization pass to the post-processing sequence. This variable is typically set based on the engine show flags and other rendering conditions.

Developers should be aware that this variable is used to control a specific rendering pass, and enabling it may have performance implications. It should be used primarily for debugging and development purposes, and typically disabled in shipping builds.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:37

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeHDR, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeHDRSF", "HDR (Eye Adaptation)"))
/** Display the illuminance debug view for the skylight */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeSkyLightIlluminance, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeSkyLightIlluminance", "Visualize SkyLight Illuminance"))
/** Helper to tweak local expsoure settings */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeLocalExposure, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeLocalExposureSF", "Local Exposure"))
/** Image based lens flares (Simulate artifact of reflections within a camera system) */
SHOWFLAG_FIXED_IN_SHIPPING(1, LensFlares, SFG_PostProcess, NSLOCTEXT("UnrealEd", "LensFlaresSF", "Lens Flares"))
/** show indirect lighting component, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's needed by r.GBuffer */
SHOWFLAG_ALWAYS_ACCESSIBLE(GlobalIllumination, SFG_LightingComponents, NSLOCTEXT("UnrealEd", "GlobalIlluminationSF", "Global Illumination"))

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:37

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeHDR, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeHDRSF", "HDR (Eye Adaptation)"))
/** Display the illuminance debug view for the skylight */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeSkyLightIlluminance, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeSkyLightIlluminance", "Visualize SkyLight Illuminance"))
/** Helper to tweak local expsoure settings */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeLocalExposure, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeLocalExposureSF", "Local Exposure"))
/** Image based lens flares (Simulate artifact of reflections within a camera system) */
SHOWFLAG_FIXED_IN_SHIPPING(1, LensFlares, SFG_PostProcess, NSLOCTEXT("UnrealEd", "LensFlaresSF", "Lens Flares"))
/** show indirect lighting component, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's needed by r.GBuffer */
SHOWFLAG_ALWAYS_ACCESSIBLE(GlobalIllumination, SFG_LightingComponents, NSLOCTEXT("UnrealEd", "GlobalIlluminationSF", "Global Illumination"))

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/IlluminanceMeter.cpp:107

Scope (from outer to inner):

file
function     FScreenPassTexture ProcessAndRenderIlluminanceMeter

Source code excerpt:

	const FScene* Scene = (const FScene*)View.Family->Scene;
	FSkyLightSceneProxy* SkyLight = Scene ? Scene->SkyLight : nullptr;
	if (!SkyLight || !View.Family->EngineShowFlags.VisualizeSkyLightIlluminance || View.bIsSceneCapture || View.bIsReflectionCapture || View.bIsPlanarReflection ||
		!CanIlluminanceMeterDisplayOnPlatform(View.GetShaderPlatform()))
	{
		return MoveTemp(ScreenPassSceneColor);
	}

	RDG_EVENT_SCOPE(GraphBuilder, "IlluminanceMeter");

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:470

Scope (from outer to inner):

file
function     void AddPostProcessingPasses

Source code excerpt:

#if WITH_EDITOR
	PassSequence.SetEnabled(EPass::VisualizeSkyAtmosphere, Scene&& View.Family && View.Family->EngineShowFlags.VisualizeSkyAtmosphere && ShouldRenderSkyAtmosphereDebugPasses(Scene, View.Family->EngineShowFlags));
	PassSequence.SetEnabled(EPass::VisualizeSkyLightIlluminanceMeter, Scene&& Scene->SkyLight && View.Family && View.Family->EngineShowFlags.VisualizeSkyLightIlluminance);
	PassSequence.SetEnabled(EPass::VisualizeLightFunctionAtlas, Scene && Scene->LightFunctionAtlasSceneData.GetLightFunctionAtlasEnabled() && View.Family && View.Family->EngineShowFlags.VisualizeLightFunctionAtlas);
	PassSequence.SetEnabled(EPass::VisualizeLevelInstance, GIsEditor && EngineShowFlags.EditingLevelInstance && EngineShowFlags.VisualizeLevelInstanceEditing && !bVisualizeHDR);
	PassSequence.SetEnabled(EPass::SelectionOutline, GIsEditor && EngineShowFlags.Selection && EngineShowFlags.SelectionOutline && !EngineShowFlags.Wireframe && !bVisualizeHDR);
	PassSequence.SetEnabled(EPass::EditorPrimitive, FSceneRenderer::ShouldCompositeEditorPrimitives(View));
#else
	PassSequence.SetEnabled(EPass::VisualizeSkyAtmosphere, false);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:4363

Scope (from outer to inner):

file
function     bool FSceneRenderer::ShouldCompositeEditorPrimitives

Source code excerpt:

{
	const FEngineShowFlags& ShowFlags = View.Family->EngineShowFlags;
	if (ShowFlags.VisualizeHDR || ShowFlags.VisualizeSkyLightIlluminance ||
		ShowFlags.VisualizePostProcessStack || View.Family->UseDebugViewPS())
	{
		// certain visualize modes get obstructed too much
		return false;
	}