ShowFlag.ColorGrading
ShowFlag.ColorGrading
#Overview
name: ShowFlag.ColorGrading
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 17
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ShowFlag.ColorGrading is to control the visibility and application of color grading effects in the rendering pipeline of Unreal Engine 5. Color grading is a post-processing effect that allows for color correction and manipulation of the final rendered image.
This setting variable is primarily used by the rendering system, specifically in the post-processing stage. It is part of the Engine’s ShowFlags system, which allows for toggling various rendering features on and off.
Based on the provided callsites, the Unreal Engine subsystems that rely on this setting variable include:
- The core Engine rendering system
- The nDisplay plugin (for multi-display and projection setups)
- The Sequencer (for cinematic tools)
- The Detail Customization system (for property editing in the editor)
The value of this variable is typically set through the engine’s show flags system, which can be controlled via the editor UI or programmatically. It’s important to note that this flag is fixed in shipping builds, meaning it cannot be changed at runtime in released games.
The ShowFlag.ColorGrading variable interacts with other rendering-related variables and systems, particularly those involved in post-processing. For example, it’s often used in conjunction with other post-process effects like bloom, tone mapping, and depth of field.
Developers should be aware that:
- Disabling this flag will turn off color grading effects, which may significantly alter the visual appearance of the game.
- In shipping builds, this flag is fixed and cannot be changed, ensuring consistent visuals.
- This flag affects performance, as color grading is a post-process effect that requires additional computation.
Best practices when using this variable include:
- Use it in conjunction with other post-processing effects for a cohesive visual style.
- Be mindful of performance implications, especially on lower-end hardware.
- Ensure that the intended visual style is maintained when this flag is toggled on and off.
Regarding the associated variable “ColorGrading”: The purpose of the ColorGrading variable is to represent a specific mode or state in the color grading UI or system. It’s used in the context of the nDisplay plugin, particularly in the color grading drawer UI.
This variable is used in the DisplayClusterColorGrading module, which is likely responsible for handling color grading in multi-display setups.
The value of this variable is set and used within the color grading UI system of the nDisplay plugin. It’s used to determine the current mode of the color grading drawer (either ColorGrading mode or DetailsView mode).
Developers working with the nDisplay plugin should be aware that:
- This variable affects the UI state and functionality of the color grading system in multi-display setups.
- It’s used to toggle between different views or modes in the color grading interface.
Best practices when using this variable in the nDisplay plugin include:
- Ensure proper state management when switching between color grading modes.
- Consider the implications on the UI and user experience when changing this value.
- Coordinate its use with other nDisplay-specific color grading settings for consistent behavior.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:85
Scope: file
Source code excerpt:
SHOWFLAG_ALWAYS_ACCESSIBLE(RectLights, SFG_LightTypes, NSLOCTEXT("UnrealEd", "RectLightsSF", "Rect Lights"))
/** Color correction after tone mapping */
SHOWFLAG_FIXED_IN_SHIPPING(1, ColorGrading, SFG_PostProcess, NSLOCTEXT("UnrealEd", "ColorGradingSF", "Color Grading"))
/** Visualize vector fields. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VectorFields, SFG_Developer, NSLOCTEXT("UnrealEd", "VectorFieldsSF", "Vector Fields"))
/** Depth of Field */
SHOWFLAG_ALWAYS_ACCESSIBLE(DepthOfField, SFG_PostProcess, NSLOCTEXT("UnrealEd", "DepthOfFieldSF", "Depth Of Field"))
/** Highlight materials that indicate performance issues or show unrealistic materials */
SHOWFLAG_FIXED_IN_SHIPPING(0, GBufferHints, SFG_Developer, NSLOCTEXT("UnrealEd", "GBufferHintsSF", "GBuffer Hints (material attributes)"))
#Associated Variable and Callsites
This variable is associated with another variable named ColorGrading
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayClusterColorGrading/Private/Drawer/DisplayClusterColorGradingDrawerState.h:9
Scope: file
Source code excerpt:
enum EDisplayClusterColorGradingDrawerMode
{
ColorGrading,
DetailsView
};
/** Stores the state of the drawer UI that can be reloaded in cases where the drawer or any of its elements are reloaded (such as when the drawer is reopened or docked) */
struct FDisplayClusterColorGradingDrawerState
{
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayClusterColorGrading/Private/Drawer/SDisplayClusterColorGradingDrawer.cpp:252
Scope (from outer to inner):
file
function void SDisplayClusterColorGradingDrawer::Construct
Source code excerpt:
.BorderImage(FAppStyle::Get().GetBrush("Brushes.Panel"))
.Padding(FMargin(2.0f, 2.0f, 2.0f, 0.0f))
.Visibility(this, &SDisplayClusterColorGradingDrawer::GetDrawerModeVisibility, EDisplayClusterColorGradingDrawerMode::ColorGrading)
[
SAssignNew(ColorWheelPanel, SDisplayClusterColorGradingColorWheelPanel)
.ColorGradingDataModelSource(ColorGradingDataModel)
]
]
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayClusterColorGrading/Private/Drawer/SDisplayClusterColorGradingDrawer.cpp:480
Scope (from outer to inner):
file
function void SDisplayClusterColorGradingDrawer::BindCommands
Source code excerpt:
CommandList->MapAction(
FDisplayClusterColorGradingCommands::Get().ColorGradingMode,
FExecuteAction::CreateSP(this, &SDisplayClusterColorGradingDrawer::OnDrawerModeSelected, EDisplayClusterColorGradingDrawerMode::ColorGrading),
FCanExecuteAction(),
FIsActionChecked::CreateSP(this, &SDisplayClusterColorGradingDrawer::IsDrawerModeSelected, EDisplayClusterColorGradingDrawerMode::ColorGrading)
);
CommandList->MapAction(
FDisplayClusterColorGradingCommands::Get().DetailViewMode,
FExecuteAction::CreateSP(this, &SDisplayClusterColorGradingDrawer::OnDrawerModeSelected, EDisplayClusterColorGradingDrawerMode::DetailsView),
FCanExecuteAction(),
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayClusterColorGrading/Private/Drawer/SDisplayClusterColorGradingDrawer.cpp:828
Scope (from outer to inner):
file
function void SDisplayClusterColorGradingDrawer::SetColorGradingDataModelObjects
Source code excerpt:
if (CurrentDrawerMode == EDisplayClusterColorGradingDrawerMode::DetailsView && ColorGradingDataModel->DetailsSections.Num() == 0)
{
CurrentDrawerMode = EDisplayClusterColorGradingDrawerMode::ColorGrading;
}
}
void SDisplayClusterColorGradingDrawer::FillColorGradingGroupToolBar()
{
if (ColorGradingGroupToolBarBox.IsValid())
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayClusterColorGrading/Private/Drawer/SDisplayClusterColorGradingDrawer.cpp:896
Scope (from outer to inner):
file
function EVisibility SDisplayClusterColorGradingDrawer::GetColorGradingGroupToolBarVisibility
Source code excerpt:
EVisibility SDisplayClusterColorGradingDrawer::GetColorGradingGroupToolBarVisibility() const
{
if (ColorGradingDataModel->bShowColorGradingGroupToolBar && CurrentDrawerMode == EDisplayClusterColorGradingDrawerMode::ColorGrading)
{
return EVisibility::Visible;
}
return EVisibility::Hidden;
}
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayClusterColorGrading/Private/Drawer/SDisplayClusterColorGradingDrawer.h:186
Scope (from outer to inner):
file
class class SDisplayClusterColorGradingDrawer : public SCompoundWidget, public FEditorUndoClient
Source code excerpt:
/** The current mode that the drawer is in */
EDisplayClusterColorGradingDrawerMode CurrentDrawerMode = EDisplayClusterColorGradingDrawerMode::ColorGrading;
/** Gets whether this widget is in a drawer or docked in a tab */
bool bIsInDrawer = false;
/** Indicates that the drawer should refresh itself on the next tick */
bool bRefreshOnNextTick = false;
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayClusterConfigurator/Private/Views/Details/Components/DisplayClusterICVFXCameraComponentDetailsCustomization.cpp:88
Scope (from outer to inner):
file
function void FDisplayClusterICVFXCameraComponentDetailsCustomization::CustomizeDetails
Source code excerpt:
InLayoutBuilder.HideCategory(TEXT("Lens"));
InLayoutBuilder.HideCategory(TEXT("LOD"));
InLayoutBuilder.HideCategory(TEXT("ColorGrading"));
InLayoutBuilder.HideCategory(TEXT("RenderingFeatures"));
InLayoutBuilder.HideCategory(TEXT("Color Grading"));
InLayoutBuilder.HideCategory(TEXT("Rendering Features"));
}
// Sockets category must be hidden manually instead of through the HideCategories metadata specifier
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayClusterTests/Private/DisplayCluster.spec.cpp:69
Scope: file
Source code excerpt:
* Convenience macro to register a set of property propagation tests for color grading rendering settings (FDisplayClusterConfigurationViewport_ColorGradingRenderingSettings).
* @param OWNER_NAME The name of the objects containing the settings. "Asset" and "Instanced" will be prepended to find the variables containing the propagated asset and receiving instance respectively.
* @param SETTINGS_FIELD The variable name of the settings struct, starting from the the owning asset (e.g. "Settings.ColorGrading" would result in Asset->Settings.ColorGrading).
* @param VALUE_FIELD_PATH A list of field names leading to the settings property, where the first name is the top-most field starting from the owner, and subsequent names are nested fields (e.g. a field within a struct).
*/
#define PROPAGATION_TEST_COLOR_GRADING_RENDERING_SETTINGS(OWNER_NAME, SETTINGS_FIELD, VALUE_FIELD_PATH) \
DoColorGradingRenderingSettingsPropagationTests<std::remove_pointer<decltype(Asset ## OWNER_NAME)>::type>( \
[this]() { return Asset ## OWNER_NAME; }, \
[this]() { return Instanced ## OWNER_NAME; }, \
[this](std::remove_pointer<decltype(Asset ## OWNER_NAME)>::type* Owner) { return &Owner->SETTINGS_FIELD; }, \
#OWNER_NAME, \
(VALUE_FIELD_PATH), \
BeforeTestAction, \
bDoInstanceOverrideTest)
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/ColorGradingVectorCustomization.cpp:1080
Scope (from outer to inner):
file
function void FColorGradingCustomBuilder::GenerateHeaderRowContent
Source code excerpt:
ParentGroupName.ReplaceInline(TEXT("|"), TEXT("_"));
GConfig->GetBool(TEXT("ColorGrading"), *FString::Printf(TEXT("%s_%s_IsRGB"), *ParentGroupName, *ColorGradingPropertyHandle.Pin()->GetPropertyDisplayName().ToString()), RGBMode, GEditorPerProjectIni);
OnChangeColorModeClicked(ECheckBoxState::Checked, RGBMode ? ColorModeType::RGB : ColorModeType::HSV);
// Register to update when an undo/redo operation has been called to update our list of actors
GEditor->RegisterForUndo(this);
}
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/ColorGradingVectorCustomization.cpp:1147
Scope (from outer to inner):
file
function void FColorGradingCustomBuilder::OnChangeColorModeClicked
Source code excerpt:
ParentGroupName.ReplaceInline(TEXT("|"), TEXT("_"));
GConfig->SetBool(TEXT("ColorGrading"), *FString::Printf(TEXT("%s_%s_IsRGB"), *ParentGroupName, *ColorGradingPropertyHandle.Pin()->GetPropertyDisplayName().ToString()), IsRGBMode, GEditorPerProjectIni);
CurrentHSVColor = FLinearColor(CurrentValueVector.X, CurrentValueVector.Y, CurrentValueVector.Z).LinearRGBToHSV();
OnCurrentHSVColorChanged.Broadcast(CurrentHSVColor, true);
// Force Refresh of the internal cache of the spinner
#Loc: <Workspace>/Engine/Source/Editor/Sequencer/Private/MVVM/ViewModels/ObjectBindingModel.cpp:648
Scope (from outer to inner):
file
namespace UE::Sequencer
function TSharedRef<SWidget> FObjectBindingModel::GetAddTrackMenuContent
Source code excerpt:
// [PostProcess Settings] [Bloom1Tint] [X]
// [PostProcess Settings] [Bloom1Tint] [Y]
// [PostProcess Settings] [ColorGrading]
// [Ortho View]
static const FString DefaultPropertyCategory = TEXT("Default");
// Properties with the category "Default" have no category and should be sorted to the top
struct FCategorySortPredicate
#Loc: <Workspace>/Engine/Source/Editor/Sequencer/Private/MVVM/ViewModels/ObjectBindingModel.cpp:794
Scope (from outer to inner):
file
namespace UE::Sequencer
function void FObjectBindingModel::HandleAddTrackSubMenuNew
Source code excerpt:
// [PostProcessSettings] [Bloom1Tint] [X]
// [PostProcessSettings] [Bloom1Tint] [Y]
// [PostProcessSettings] [ColorGrading]
// Create property menu data based on keyable property paths
TArray<FProperty*> PropertiesTraversed;
TArray<int32> ArrayIndicesTraversed;
TArray<PropertyMenuData> KeyablePropertyMenuData;
for (const FPropertyPath& KeyablePropertyPath : KeyablePropertyPaths)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ShowFlags.cpp:643
Scope (from outer to inner):
file
function void EngineShowFlagOverride
Source code excerpt:
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)
DISABLE_ENGINE_SHOWFLAG(MotionBlur)
DISABLE_ENGINE_SHOWFLAG(DirectLighting)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:85
Scope: file
Source code excerpt:
SHOWFLAG_ALWAYS_ACCESSIBLE(RectLights, SFG_LightTypes, NSLOCTEXT("UnrealEd", "RectLightsSF", "Rect Lights"))
/** Color correction after tone mapping */
SHOWFLAG_FIXED_IN_SHIPPING(1, ColorGrading, SFG_PostProcess, NSLOCTEXT("UnrealEd", "ColorGradingSF", "Color Grading"))
/** Visualize vector fields. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VectorFields, SFG_Developer, NSLOCTEXT("UnrealEd", "VectorFieldsSF", "Vector Fields"))
/** Depth of Field */
SHOWFLAG_ALWAYS_ACCESSIBLE(DepthOfField, SFG_PostProcess, NSLOCTEXT("UnrealEd", "DepthOfFieldSF", "Depth Of Field"))
/** Highlight materials that indicate performance issues or show unrealistic materials */
SHOWFLAG_FIXED_IN_SHIPPING(0, GBufferHints, SFG_Developer, NSLOCTEXT("UnrealEd", "GBufferHintsSF", "GBuffer Hints (material attributes)"))
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessCombineLUTs.cpp:216
Scope (from outer to inner):
file
function void GetCombineLUTParameters
Source code excerpt:
const FSceneViewFamily& ViewFamily = *(View.Family);
const FPostProcessSettings& Settings = (
ViewFamily.EngineShowFlags.ColorGrading && CVarColorGrading.GetValueOnRenderThread() != 0)
? View.FinalPostProcessSettings
: DefaultSettings;
for (uint32 BlendIndex = 0; BlendIndex < BlendCount; ++BlendIndex)
{
// Neutral texture occupies the first slot and doesn't actually need to be set.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessCombineLUTs.cpp:486
Scope (from outer to inner):
file
function FRDGTextureRef AddCombineLUTPass
Source code excerpt:
LocalWeights[0] = 1.0f;
if (ViewFamily.EngineShowFlags.ColorGrading)
{
LocalCount = GenerateFinalTable(View.FinalPostProcessSettings, LocalTextures, LocalWeights, GMaxLUTBlendCount);
}
const bool bUseComputePass = View.bUseComputePasses;