ShowFlag.LensFlares
ShowFlag.LensFlares
#Overview
name: ShowFlag.LensFlares
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 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ShowFlag.LensFlares is to control the visibility of image-based lens flares, which simulate the artifact of reflections within a camera system. This setting is part of Unreal Engine’s post-processing system.
This setting variable is primarily used in the rendering and post-processing subsystems of Unreal Engine. It’s referenced in the Engine module, specifically in the SceneView and ShowFlags components.
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. By default, it’s enabled in shipping builds as indicated by the SHOWFLAG_FIXED_IN_SHIPPING macro with a value of 1.
The associated variable LensFlares interacts directly with ShowFlag.LensFlares. When ShowFlag.LensFlares is disabled, the LensFlareIntensity in the FinalPostProcessSettings is set to 0, effectively turning off lens flares in the rendering pipeline.
Developers should be aware that this flag affects the visual quality and performance of the rendering. Enabling lens flares can add to the visual fidelity of a scene but may have a performance cost, especially on lower-end hardware.
Best practices when using this variable include:
- Consider the performance impact when enabling lens flares, especially for mobile or VR platforms.
- Use it in conjunction with other post-processing effects for a cohesive visual style.
- Be mindful of overusing lens flares, as they can be distracting if not used judiciously.
Regarding the associated variable LensFlares:
The purpose of LensFlares is to represent the actual lens flare effect in the post-processing pipeline. It’s closely tied to ShowFlag.LensFlares and is used to control the intensity and presence of lens flares in the final rendered image.
This variable is used in the post-processing subsystem of the Engine module. It’s primarily referenced in the SceneView component for applying post-processing effects.
The value of LensFlares is typically set through the post-processing volume or camera settings in the editor. However, its effect can be overridden or disabled entirely based on the ShowFlag.LensFlares setting.
LensFlares interacts directly with ShowFlag.LensFlares. When ShowFlag.LensFlares is false, the LensFlareIntensity is set to 0, effectively disabling the lens flare effect regardless of other settings.
Developers should be aware that the actual visual impact of lens flares depends on both this variable and the ShowFlag.LensFlares setting. Even if LensFlares is enabled in the post-processing settings, it won’t be visible if ShowFlag.LensFlares is turned off.
Best practices for using LensFlares include:
- Adjust the intensity to achieve a subtle effect that enhances the scene without being overpowering.
- Use in combination with other lighting and post-processing effects for a realistic camera-like visual.
- Consider the context of the scene - lens flares are most appropriate in bright, sun-lit environments or when simulating a camera view.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:41
Scope: file
Source code excerpt:
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"))
/** Darkens the screen borders (Camera artifact and artistic effect) */
SHOWFLAG_ALWAYS_ACCESSIBLE(Vignette, SFG_PostProcess, NSLOCTEXT("UnrealEd", "VignetteSF", "Vignette"))
/** Fine film grain */
SHOWFLAG_FIXED_IN_SHIPPING(1, Grain, SFG_PostProcess, NSLOCTEXT("UnrealEd", "GrainSF", "Grain"))
#Associated Variable and Callsites
This variable is associated with another variable named LensFlares
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:2133
Scope (from outer to inner):
file
function void FSceneView::EndFinalPostprocessSettings
Source code excerpt:
}
if(!Family->EngineShowFlags.LensFlares)
{
FinalPostProcessSettings.LensFlareIntensity = 0;
}
if (!Family->EngineShowFlags.ToneCurve)
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ShowFlags.cpp:641
Scope (from outer to inner):
file
function void EngineShowFlagOverride
Source code excerpt:
DISABLE_ENGINE_SHOWFLAG(CameraImperfections)
DISABLE_ENGINE_SHOWFLAG(Decals)
DISABLE_ENGINE_SHOWFLAG(LensFlares)
DISABLE_ENGINE_SHOWFLAG(Bloom)
DISABLE_ENGINE_SHOWFLAG(ColorGrading)
DISABLE_ENGINE_SHOWFLAG(Tonemapper)
DISABLE_ENGINE_SHOWFLAG(Refraction)
DISABLE_ENGINE_SHOWFLAG(ReflectionEnvironment)
DISABLE_ENGINE_SHOWFLAG(AmbientCubemap)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:41
Scope: file
Source code excerpt:
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"))
/** Darkens the screen borders (Camera artifact and artistic effect) */
SHOWFLAG_ALWAYS_ACCESSIBLE(Vignette, SFG_PostProcess, NSLOCTEXT("UnrealEd", "VignetteSF", "Vignette"))
/** Fine film grain */
SHOWFLAG_FIXED_IN_SHIPPING(1, Grain, SFG_PostProcess, NSLOCTEXT("UnrealEd", "GrainSF", "Grain"))