ShowFlag.VisualizeLightingOnProbes
ShowFlag.VisualizeLightingOnProbes
#Overview
name: ShowFlag.VisualizeLightingOnProbes
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allows to override a specific showflag (works in editor and game, \
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ShowFlag.VisualizeLightingOnProbes is to enable debug visualization of diffuse and specular lighting (both direct and indirect) using probes in Unreal Engine 5’s rendering system.
This setting variable is primarily used in the rendering system, specifically in the debug probe rendering subsystem. It is part of the engine’s show flags, which are used to toggle various debug visualization features.
Based on the callsites, this variable is utilized in the Renderer module, particularly in the DebugProbeRendering.cpp file. It’s used to control the visualization of lighting on probes in different rendering passes.
The value of this variable is set through the engine’s show flags system. It can be toggled on or off in the editor or through code.
This variable interacts with another variable named VisualizeLightingOnProbes. They share the same value and are used interchangeably in the code.
Developers should be aware that this variable is fixed in shipping builds, meaning it’s not accessible in final release versions of the game. It’s primarily intended for debugging and development purposes.
Best practices when using this variable include:
- Only enable it when debugging lighting issues or when you need to visualize the lighting information on probes.
- Remember to disable it before building the final release version of the game.
- Use it in conjunction with other debugging tools to get a comprehensive understanding of the lighting system.
Regarding the associated variable VisualizeLightingOnProbes:
This variable is used in the same context as ShowFlag.VisualizeLightingOnProbes. It’s used to control the debug probe mode in the rendering process. The value of this variable is determined either by the engine show flags or by a console variable (CVarVisualizeLightingOnProbes).
In the code, it’s used to set the DebugProbesMode parameter, which affects how the lighting on probes is visualized. The value is clamped between 0 and 3, suggesting there are different levels or modes of visualization.
Developers should be aware that this variable can be controlled both through the engine show flags and through a console variable, providing flexibility in how it’s set and used during development and debugging.
When using this variable, developers should:
- Understand the different visualization modes (0-3) and what they represent.
- Be aware of the potential performance impact of enabling this visualization, especially in complex scenes.
- Use it in conjunction with ShowFlag.VisualizeLightingOnProbes for a complete debugging experience of the lighting system on probes.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:341
Scope: file
Source code excerpt:
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeGlobalDistanceField, SFG_Visualize, NSLOCTEXT("UnrealEd", "GlobalDistanceFieldSF", "Global DistanceField"))
/** Enable the debug visualization of diffuse/specular lighting (direct and indirect) using probes */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeLightingOnProbes, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeLightingOnProbesSF", "Visualize Lighting on Probes"))
/** Screen space AO, for now SHOWFLAG_ALWAYS_ACCESSIBLE because r.GBuffer need that */
SHOWFLAG_ALWAYS_ACCESSIBLE(ScreenSpaceAO, SFG_LightingFeatures, NSLOCTEXT("UnrealEd", "ScreenSpaceAOSF", "Screen Space Ambient Occlusion"))
/** Distance field AO, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(DistanceFieldAO, SFG_LightingFeatures, NSLOCTEXT("UnrealEd", "DistanceFieldAOSF", "Distance Field Ambient Occlusion"))
/** Lumen GI */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenGlobalIllumination, SFG_LightingFeatures, NSLOCTEXT("UnrealEd", "LumenGlobalIlluminationSF", "Lumen Global Illumination"))
#Associated Variable and Callsites
This variable is associated with another variable named VisualizeLightingOnProbes
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:341
Scope: file
Source code excerpt:
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeGlobalDistanceField, SFG_Visualize, NSLOCTEXT("UnrealEd", "GlobalDistanceFieldSF", "Global DistanceField"))
/** Enable the debug visualization of diffuse/specular lighting (direct and indirect) using probes */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeLightingOnProbes, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeLightingOnProbesSF", "Visualize Lighting on Probes"))
/** Screen space AO, for now SHOWFLAG_ALWAYS_ACCESSIBLE because r.GBuffer need that */
SHOWFLAG_ALWAYS_ACCESSIBLE(ScreenSpaceAO, SFG_LightingFeatures, NSLOCTEXT("UnrealEd", "ScreenSpaceAOSF", "Screen Space Ambient Occlusion"))
/** Distance field AO, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(DistanceFieldAO, SFG_LightingFeatures, NSLOCTEXT("UnrealEd", "DistanceFieldAOSF", "Distance Field Ambient Occlusion"))
/** Lumen GI */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenGlobalIllumination, SFG_LightingFeatures, NSLOCTEXT("UnrealEd", "LumenGlobalIlluminationSF", "Lumen Global Illumination"))
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DebugProbeRendering.cpp:104
Scope (from outer to inner):
file
function static void CommonStampDeferredDebugProbeDrawCall
Source code excerpt:
PassParameters->MaxBytesPerPixel = View.SubstrateViewData.SceneData->EffectiveMaxBytesPerPixel;
PassParameters->bRoughDiffuse = View.SubstrateViewData.SceneData->bRoughDiffuse ? 1 : 0;
PassParameters->DebugProbesMode = View.Family->EngineShowFlags.VisualizeLightingOnProbes ? 3 : FMath::Clamp(CVarVisualizeLightingOnProbes.GetValueOnRenderThread(), 0, 3);
FStampDeferredDebugProbePS::FPermutationDomain PermutationVector;
PermutationVector.Set<FStampDeferredDebugProbePS::FRenderPass>(RenderPass);
PermutationVector.Set<FStampDeferredDebugProbePS::FIlluminanceMeter>(bIlluminanceMeter);
TShaderMapRef<FStampDeferredDebugProbePS> PixelShader(View.ShaderMap, PermutationVector);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DebugProbeRendering.cpp:139
Scope (from outer to inner):
file
function void StampDeferredDebugProbeDepthPS
Source code excerpt:
{
const bool bViewRequiresAndSupportsIlluminanceMeter = ViewRequiresAndSupportsIlluminanceMeter(View);
if (!(bVisualizeLightingOnProbes || View.Family->EngineShowFlags.VisualizeLightingOnProbes) || View.bIsReflectionCapture || bViewRequiresAndSupportsIlluminanceMeter)
{
// When "Visualizing HDR with Illuminance Meter", we want to evaluated the illuminance on the surface behind the target square patch.
// So we do not want write depth or velocity in this case.
continue;
}
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DebugProbeRendering.cpp:173
Scope (from outer to inner):
file
function void StampDeferredDebugProbeMaterialPS
Source code excerpt:
{
const bool bViewRequiresAndSupportsIlluminanceMeter = ViewRequiresAndSupportsIlluminanceMeter(View);
if (!(bVisualizeLightingOnProbes || View.Family->EngineShowFlags.VisualizeLightingOnProbes || bViewRequiresAndSupportsIlluminanceMeter) || View.bIsReflectionCapture)
{
continue;
}
FStampDeferredDebugProbePS::FParameters* PassParameters = GraphBuilder.AllocParameters<FStampDeferredDebugProbePS::FParameters>();
PassParameters->RenderTargets = BasePassRenderTargets;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DebugProbeRendering.cpp:238
Scope (from outer to inner):
file
function void StampDeferredDebugProbeVelocityPS
Source code excerpt:
{
const bool bViewRequiresAndSupportsIlluminanceMeter = ViewRequiresAndSupportsIlluminanceMeter(View);
if (!(bVisualizeLightingOnProbes || View.Family->EngineShowFlags.VisualizeLightingOnProbes) || View.bIsReflectionCapture || bViewRequiresAndSupportsIlluminanceMeter)
{
// When "Visualizing HDR with Illuminance Meter", we want to evaluated the illuminance on the surface behind the target square patch.
// So we do not want write depth or velocity in this case.
continue;
}