HistoryColor
HistoryColor
#Overview
name: HistoryColor
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 13
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of HistoryColor is to represent the color associated with historical data in various rendering and user interface contexts within Unreal Engine 5. This variable is used in multiple subsystems, including animation, console, and rendering components.
The HistoryColor variable is utilized by the following Unreal Engine subsystems, plugins, or modules:
- Animation system: In the motion trajectory debugging and visualization.
- Console system: For coloring previously typed commands in the console history.
- Rendering system: Specifically in the Global Texture Ambient Occlusion (GTAO) post-processing pipeline.
The value of this variable is set differently depending on the context:
- For motion trajectory visualization, it’s set as a default parameter in the function declaration.
- In the console system, it’s configured as a UPROPERTY in the ConsoleSettings class.
- For GTAO rendering, it’s derived from input history textures or a default white texture.
HistoryColor interacts with other variables such as PredictionColor in motion trajectory visualization, and various texture and viewport-related variables in the GTAO rendering pipeline.
Developers should be aware of the following when using this variable:
- The context-dependent nature of HistoryColor, as it serves different purposes in different subsystems.
- In rendering contexts, it’s often associated with texture and viewport information.
- For motion trajectory visualization, it’s used in color interpolation with PredictionColor.
Best practices when using this variable include:
- Ensure appropriate color values are set for each context to maintain visual consistency.
- In rendering pipelines, properly manage the lifetime and validity of associated textures and viewports.
- When used for debugging or visualization purposes, consider making the color configurable for better flexibility.
- In the console system, respect the user’s color preferences as set in the ConsoleSettings.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseInput.ini:252, section: [/Script/EngineSettings.ConsoleSettings]
- INI Section:
/Script/EngineSettings.ConsoleSettings
- Raw value:
(R=180,G=180,B=180,A=255)
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/MotionTrajectoryTypes.cpp:192
Scope (from outer to inner):
file
function void FTrajectorySampleRange::DebugDrawTrajectory
Source code excerpt:
, const FTransform& WorldTransform
, const FLinearColor PredictionColor
, const FLinearColor HistoryColor
, float TransformScale
, float TransformThickness
, float VelArrowScale
, float VelArrowSize
, float VelArrowThickness) const
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/MotionTrajectoryTypes.cpp:221
Scope (from outer to inner):
file
function void FTrajectorySampleRange::DebugDrawTrajectory
Source code excerpt:
// Interpolate the history and prediction color over the entire trajectory range
const float ColorLerp = static_cast<float>(Idx) / static_cast<float>(Num);
const FLinearColor Color = FLinearColor::LerpUsingHSV(PredictionColor, HistoryColor, ColorLerp);
if (VelArrowScale > 0.0f)
{
DrawDebugDirectionalArrow(
World, SamplePositionWS, WorldVelocity,
VelArrowSize, Color.ToFColor(true), false, 0.f, 0, VelArrowThickness);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UserInterface/Console.cpp:586
Scope (from outer to inner):
file
function void UConsole::SetAutoCompleteFromHistory
Source code excerpt:
Cmd.Command = HistoryBuffer[i];
Cmd.Color = ConsoleSettings->HistoryColor;
Cmd.SetHistory();
AutoComplete.Add(Cmd);
}
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/Animation/MotionTrajectoryTypes.h:78
Scope: file
Source code excerpt:
, const FTransform& WorldTransform
, const FLinearColor PredictionColor = { 0.f, 1.f, 0.f }
, const FLinearColor HistoryColor = { 0.f, 0.f, 1.f }
, float TransformScale = 10.f
, float TransformThickness = 2.f
, float VelArrowScale = 0.025f
, float VelArrowSize = 40.f
, float VelArrowThickness = 2.f) const;
};
#Loc: <Workspace>/Engine/Source/Runtime/EngineSettings/Classes/ConsoleSettings.h:92
Scope (from outer to inner):
file
class class UConsoleSettings : public UObject
Source code excerpt:
/** The color used for the previously typed commands history. */
UPROPERTY(config, EditAnywhere, Category=Colors)
FColor HistoryColor;
/** The autocomplete color used for executable commands. */
UPROPERTY(config, EditAnywhere, Category=Colors)
FColor AutoCompleteCommandColor;
/** The autocomplete color used for mutable CVars. */
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/CompositionLighting.cpp:267
Scope (from outer to inner):
file
function static FScreenPassTexture AddPostProcessingGTAOAllPasses
Source code excerpt:
FScreenPassTextureViewport HistoryViewport(InputHistory.ReferenceBufferSize, InputHistory.ViewportRect);
FScreenPassTexture HistoryColor;
if (InputHistory.IsValid())
{
HistoryColor = FScreenPassTexture(GraphBuilder.RegisterExternalTexture(InputHistory.RT, TEXT("GTAOHistoryColor")), HistoryViewport.Rect);
}
else
{
HistoryColor = FScreenPassTexture(GraphBuilder.RegisterExternalTexture(GSystemTextures.WhiteDummy, TEXT("GTAODummyTexture")));
HistoryViewport = FScreenPassTextureViewport(HistoryColor);
}
FGTAOTemporalOutputs TemporalOutputs =
AddGTAOTemporalPass(
GraphBuilder,
View,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/CompositionLighting.cpp:287
Scope (from outer to inner):
file
function static FScreenPassTexture AddPostProcessingGTAOAllPasses
Source code excerpt:
CommonParameters.SceneDepth,
CommonParameters.SceneVelocity,
HistoryColor,
HistoryViewport);
OutputHistory->SafeRelease();
GraphBuilder.QueueTextureExtraction(TemporalOutputs.OutputAO.Texture, &OutputHistory->RT);
OutputHistory->ReferenceBufferSize = TemporalOutputs.TargetExtent;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/CompositionLighting.cpp:367
Scope (from outer to inner):
file
function static FScreenPassTexture AddPostProcessingGTAOPostAsync
Source code excerpt:
FScreenPassTextureViewport HistoryViewport(InputHistory.ReferenceBufferSize, InputHistory.ViewportRect);
FScreenPassTexture HistoryColor;
if (InputHistory.IsValid())
{
HistoryColor = FScreenPassTexture(GraphBuilder.RegisterExternalTexture(InputHistory.RT, TEXT("GTAOHistoryColor")), HistoryViewport.Rect);
}
else
{
HistoryColor = FScreenPassTexture(GraphBuilder.RegisterExternalTexture(GSystemTextures.WhiteDummy, TEXT("GTAODummyTexture")));
HistoryViewport = FScreenPassTextureViewport(HistoryColor);
}
FGTAOTemporalOutputs TemporalOutputs =
AddGTAOTemporalPass(
GraphBuilder,
View,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/CompositionLighting.cpp:387
Scope (from outer to inner):
file
function static FScreenPassTexture AddPostProcessingGTAOPostAsync
Source code excerpt:
CommonParameters.SceneDepth,
CommonParameters.SceneVelocity,
HistoryColor,
HistoryViewport);
OutputHistory->SafeRelease();
GraphBuilder.QueueTextureExtraction(TemporalOutputs.OutputAO.Texture, &OutputHistory->RT);
OutputHistory->ReferenceBufferSize = TemporalOutputs.TargetExtent;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessAmbientOcclusion.cpp:1398
Scope (from outer to inner):
file
function FGTAOTemporalOutputs AddGTAOTemporalPass
Source code excerpt:
FScreenPassTexture SceneDepth,
FScreenPassTexture SceneVelocity,
FScreenPassTexture HistoryColor,
FScreenPassTextureViewport HistoryViewport)
{
RDG_GPU_STAT_SCOPE(GraphBuilder, GTAO_TemporalFilter);
const FScreenPassTextureViewport InputViewport(Input);
const FScreenPassTextureViewport OutputViewport(InputViewport);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessAmbientOcclusion.cpp:1422
Scope (from outer to inner):
file
function FGTAOTemporalOutputs AddGTAOTemporalPass
Source code excerpt:
}
const FVector2f HistoryTextureSize = FVector2f(HistoryColor.Texture->Desc.Extent);
const FVector2f HistoryTexturePixelSize = FVector2f(1.0f) / HistoryTextureSize;
const FIntPoint ViewportOffset = HistoryViewport.Rect.Min;
const FIntPoint ViewportExtent = HistoryViewport.Rect.Size();
const FIntPoint BufferSize = HistoryViewport.Extent;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessAmbientOcclusion.cpp:1448
Scope (from outer to inner):
file
function FGTAOTemporalOutputs AddGTAOTemporalPass
Source code excerpt:
PassParameters->GTAOTemporalInputPixelSize = FVector2f(1.0f) / FVector2f(InputViewport.Extent);
PassParameters->HistoryTexture = HistoryColor.Texture;
PassParameters->HistoryTextureSampler = TStaticSamplerState<SF_Point, AM_Border, AM_Border, AM_Border, 0, 0, 0xffffffff >::GetRHI();
PassParameters->HistoryTextureSize = HistoryTextureSize;
PassParameters->HistoryTexturePixelSize = HistoryTexturePixelSize;
PassParameters->ZCurrTexture = SceneDepth.Texture;
PassParameters->ZCurrTextureSampler = TStaticSamplerState<SF_Point, AM_Wrap, AM_Wrap, AM_Wrap>::GetRHI();
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessAmbientOcclusion.h:208
Scope: file
Source code excerpt:
FScreenPassTexture SceneDepth,
FScreenPassTexture SceneVelocity,
FScreenPassTexture HistoryColor,
FScreenPassTextureViewport HistoryViewport);
FScreenPassTexture AddGTAOSpatialFilter(
FRDGBuilder& GraphBuilder,
const FViewInfo& View,
const FGTAOCommonParameters& CommonParameters,