ShowFlag.Vignette

ShowFlag.Vignette

#Overview

name: ShowFlag.Vignette

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

It is referenced in 9 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ShowFlag.Vignette is to control the visibility of the vignette post-processing effect in Unreal Engine 5. Vignette is a camera artifact and artistic effect that darkens the screen borders.

This setting variable is primarily used in the post-processing subsystem of Unreal Engine. It is part of the engine’s rendering pipeline and affects the final image output.

The value of this variable is set in various places:

  1. It is defined as a show flag in the engine’s ShowFlagsValues.inl file.
  2. It can be modified through the engine’s show flags system, which allows toggling of various rendering features.
  3. It can be adjusted programmatically, as seen in the OpenXRHMD plugin where it’s set to 0 for certain VR scenarios.

The ShowFlag.Vignette interacts with other variables, notably:

  1. FinalPostProcessSettings.VignetteIntensity: If ShowFlag.Vignette is false, VignetteIntensity is set to 0, effectively disabling the vignette effect.
  2. It’s often used alongside other post-processing effects like Bloom and Grain.

Developers should be aware that:

  1. Disabling this flag will completely turn off the vignette effect, regardless of other vignette-related settings.
  2. In VR applications, especially those using more than two views, the engine might automatically disable vignette for performance or comfort reasons.

Best practices when using this variable include:

  1. Consider the performance impact of enabling/disabling the vignette effect.
  2. Be mindful of its use in VR applications, as it might affect user comfort.
  3. Use it in conjunction with other post-processing settings for a cohesive visual style.

Regarding the associated variable Vignette:

The purpose of Vignette is to store the intensity or amount of the vignette effect. It’s used in various parts of the engine, particularly in the Datasmith system for importing and processing scene data.

This variable is used in the Datasmith subsystem and is part of the post-processing element implementation.

The value of this variable can be set through various Datasmith-related functions, such as SetVignette in the UDatasmithPostProcessElement class.

Vignette interacts with other post-processing variables like Temperature, ColorFilter, Dof (Depth of Field), MotionBlur, and Saturation.

Developers should be aware that:

  1. This variable represents the intensity of the vignette effect, not just whether it’s enabled or disabled.
  2. It’s part of a larger set of post-processing parameters in the Datasmith system.

Best practices when using this variable include:

  1. Use it in conjunction with other post-processing parameters for a balanced visual effect.
  2. Consider the overall mood and style of your scene when adjusting this value.
  3. Be mindful of performance implications when using multiple post-processing effects simultaneously.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

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"))
/** Screen Space Ambient Occlusion, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(AmbientOcclusion, SFG_LightingComponents, NSLOCTEXT("UnrealEd", "AmbientOcclusionSF", "Ambient Occlusion"))
/** Decal rendering, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(Decals, SFG_Normal, NSLOCTEXT("UnrealEd", "DecalsSF", "Decals"))

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithImporter/Source/DatasmithImporter/Public/ObjectElements/DatasmithUObjectElements.h:617

Scope (from outer to inner):

file
class        class UDatasmithPostProcessElement : public UDatasmithObjectElement

Source code excerpt:

	/** Set vignette amount */
	UFUNCTION(BlueprintCallable, Category="Datasmith | Element")
	void SetVignette(float Vignette);

	/** Get depth of field multiplier */
	UFUNCTION(BlueprintCallable, Category="Datasmith | Element")
	float GetDof() const;

	/** Set depth of field multiplier */

#Loc: <Workspace>/Engine/Plugins/Runtime/OpenXR/Source/OpenXRHMD/Private/OpenXRHMD.cpp:1235

Scope (from outer to inner):

file
function     void FOpenXRHMD::SetupViewFamily

Source code excerpt:

	if (FrameState.Views.Num() > 2)
	{
		InViewFamily.EngineShowFlags.Vignette = 0;
		InViewFamily.EngineShowFlags.Bloom = 0;
	}
}

void FOpenXRHMD::SetupView(FSceneViewFamily& InViewFamily, FSceneView& InView)
{

#Loc: <Workspace>/Engine/Source/Runtime/Datasmith/DatasmithCore/Private/DatasmithSceneElementsImpl.cpp:212

Scope (from outer to inner):

file
function     FDatasmithPostProcessElementImpl::FDatasmithPostProcessElementImpl

Source code excerpt:

	, Temperature(6500.0f)
	, ColorFilter(FVector3f::ZeroVector)
	, Vignette(0.0f)
	, Dof(0.0f)
	, MotionBlur(0.0f)
	, Saturation(1.0f)
	, CameraISO(-1.f) // Negative means don't override
	, CameraShutterSpeed(-1.f)
	, Fstop(-1.f)
{
	Store.RegisterParameter(Temperature,        "Temperature"        );
	Store.RegisterParameter(Vignette,           "Vignette"           );
	Store.RegisterParameter(Dof,                "Dof"                );
	Store.RegisterParameter(MotionBlur,         "MotionBlur"         );
	Store.RegisterParameter(Saturation,         "Saturation"         );
	Store.RegisterParameter(ColorFilter,        "ColorFilter"        );
	Store.RegisterParameter(CameraISO,          "CameraISO"          );
	Store.RegisterParameter(CameraShutterSpeed, "CameraShutterSpeed" );

#Loc: <Workspace>/Engine/Source/Runtime/Datasmith/DatasmithCore/Private/DatasmithSceneElementsImpl.h:810

Scope (from outer to inner):

file
class        class FDatasmithPostProcessElementImpl : public FDatasmithElementImpl< IDatasmithPostProcessElement >
function     virtual float GetVignette

Source code excerpt:

	virtual void SetColorFilter(FLinearColor InColorFilter) override { ColorFilter = InColorFilter; }

	virtual float GetVignette() const override { return Vignette; }
	virtual void SetVignette(float InVignette) override { Vignette = InVignette; }

	virtual float GetDof() const override { return Dof; }
	virtual void SetDof(float InDof) override { Dof = InDof; }

	virtual float GetMotionBlur() const override { return MotionBlur; }
	virtual void SetMotionBlur(float InMotionBlur) override { MotionBlur = InMotionBlur; }

#Loc: <Workspace>/Engine/Source/Runtime/Datasmith/DatasmithCore/Private/DatasmithSceneElementsImpl.h:834

Scope (from outer to inner):

file
class        class FDatasmithPostProcessElementImpl : public FDatasmithElementImpl< IDatasmithPostProcessElement >

Source code excerpt:

	TReflected<float> Temperature;
	TReflected<FLinearColor> ColorFilter;
	TReflected<float> Vignette;
	TReflected<float> Dof;
	TReflected<float> MotionBlur;
	TReflected<float> Saturation;
	TReflected<float> CameraISO;
	TReflected<float> CameraShutterSpeed;
	TReflected<float> Fstop;

#Loc: <Workspace>/Engine/Source/Runtime/Datasmith/DatasmithCore/Public/IDatasmithSceneElements.h:715

Scope (from outer to inner):

file
class        class IDatasmithPostProcessElement : public IDatasmithElement

Source code excerpt:


	/** Set vignette amount */
	virtual void SetVignette(float Vignette) = 0;

	/** Get depth of field multiplier */
	virtual float GetDof() const = 0;

	/** Set depth of field multiplier */
	virtual void SetDof(float Dof) = 0;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:2113

Scope (from outer to inner):

file
function     void FSceneView::EndFinalPostprocessSettings

Source code excerpt:

	}

	if(!Family->EngineShowFlags.Vignette)
	{
		FinalPostProcessSettings.VignetteIntensity = 0;
	}

	if(!Family->EngineShowFlags.Grain)
	{

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

Scope: file

Source code excerpt:

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"))
/** Screen Space Ambient Occlusion, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(AmbientOcclusion, SFG_LightingComponents, NSLOCTEXT("UnrealEd", "AmbientOcclusionSF", "Ambient Occlusion"))
/** Decal rendering, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(Decals, SFG_Normal, NSLOCTEXT("UnrealEd", "DecalsSF", "Decals"))