PostTonemapHDRColor
PostTonemapHDRColor
#Overview
name: PostTonemapHDRColor
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 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of PostTonemapHDRColor is to provide access to the scene color after tonemapping has been applied in the post-processing pipeline of Unreal Engine 5’s rendering system. This variable represents a crucial stage in the rendering process where the high dynamic range (HDR) color data has been mapped to a displayable range.
This setting variable is primarily used in the Renderer module of Unreal Engine 5, specifically within the post-processing subsystem. It is referenced in the visualization of GBuffer and in the general post-processing passes.
The value of PostTonemapHDRColor is set during the post-processing chain, specifically after the tonemapping operation has been performed on the scene color. It is typically populated with the output of the tonemapping pass.
PostTonemapHDRColor interacts closely with PreTonemapHDRColor, which represents the scene color before tonemapping. These two variables are often used together to provide before-and-after comparisons or to allow post-processing materials to access both pre-tonemapped and post-tonemapped color data.
Developers must be aware that PostTonemapHDRColor represents color data that has already undergone dynamic range compression. This means the values are no longer in a high dynamic range and have been adjusted for display on standard monitors. Any further color manipulations should take this into account to avoid unexpected results.
Best practices when using this variable include:
- Use it when you need to perform post-processing operations that should work with display-ready colors.
- Be cautious about performing operations that might expand the color range beyond what is displayable.
- Consider using PreTonemapHDRColor instead if you need to work with the full dynamic range of the scene.
- When creating custom post-process materials, use this input when you want to work with colors as they will appear in the final render.
- Remember that this data is in the color space defined by your project’s color grading settings, which may affect how you should interpret and manipulate the colors.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:2925, section: [Engine.BufferVisualizationMaterials]
- INI Section:
Engine.BufferVisualizationMaterials
- Raw value:
(Material="/Engine/BufferVisualization/PostTonemapHDRColor.PostTonemapHDRColor", Name=LOCTEXT("PostTonemapHDRColor", "Post Tonemap HDR Color"), ApplyAutoExposure=true)
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessVisualizeBuffer.cpp:350
Scope (from outer to inner):
file
function FScreenPassTexture AddVisualizeGBufferOverviewPass
Source code excerpt:
PostProcessMaterialInputs.SetInput(GraphBuilder, EPostProcessMaterialInput::SeparateTranslucency, Inputs.SeparateTranslucency);
PostProcessMaterialInputs.SetInput(GraphBuilder, EPostProcessMaterialInput::PreTonemapHDRColor, Inputs.SceneColorBeforeTonemap);
PostProcessMaterialInputs.SetInput(GraphBuilder, EPostProcessMaterialInput::PostTonemapHDRColor, Inputs.SceneColorAfterTonemap);
PostProcessMaterialInputs.SetInput(GraphBuilder, EPostProcessMaterialInput::Velocity, Inputs.Velocity);
if (View.Family->EngineShowFlags.PathTracing && Inputs.PathTracingResources->bPostProcessEnabled)
{
const FPathTracingResources& PathTracingResources = *Inputs.PathTracingResources;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:1299
Scope (from outer to inner):
file
function void AddPostProcessingPasses
Source code excerpt:
PassSequence.AcceptOverrideIfLastPass(EPass::PostProcessMaterialAfterTonemapping, PassInputs.OverrideOutput);
PassInputs.SetInput(GraphBuilder, EPostProcessMaterialInput::PreTonemapHDRColor, FScreenPassTexture::CopyFromSlice(GraphBuilder, SceneColorBeforeTonemapSlice));
PassInputs.SetInput(GraphBuilder, EPostProcessMaterialInput::PostTonemapHDRColor, SceneColorAfterTonemap);
PassInputs.SceneTextures = GetSceneTextureShaderParameters(Inputs.SceneTextures);
SceneColor = AddPostProcessMaterialChain(GraphBuilder, View, PassInputs, PostProcessMaterialAfterTonemappingChain);
}
if (PassSequence.IsEnabled(EPass::VisualizeLumenScene))
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Public/PostProcess/PostProcessMaterialInputs.h:26
Scope: file
Source code excerpt:
// Buffer Visualization Only.
PreTonemapHDRColor = 2,
PostTonemapHDRColor = 3,
// Active if separate velocity pass is used--i.e. not part of base pass; Not active during Replace Tonemap.
Velocity = 4
};
enum class EPathTracingPostProcessMaterialInput : uint32