Files
UnrealEngineUWP/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessVisualizeBuffer.h
Guillaume Abadie 672fcb0d3c Implements a VisualizeTemporalUpscaler show flag to more quickly diagnose common problems
* All buffers are anoted with the VisualizeTexture command to see it;
* Velocity buffer is visualized with the VisualizeMotionBlur to make it obvious motion vector are important and need to be coherent, and VisualizeReprojection to make sure the reprojection lines up perfectly;
* SceneDepth is shown with the same pixel shader as the VisualizeTexture to not confuse the user;
* PostDOF translucency is shown along with it's alpha channel given how benefical it is to minimise ghosting on translucency that don't draw velocity;
* SceneColor and PostDOF translucency is shown in linear color space to make it obvious when pre-exposure arises;
* When r.PostProcessing.PropagateAlpha is enabled, alpha channel of SceneColor and temporal upscaler's output are displayed;
* The luminance used for flickering detection is also displayed for user to identify what is subject to detection of the flickering;

Summary is displayed with:
* Which temporal upscaler is being used and what anti-aliasing scalability group
* Input resolution and pixel format
* Output resolution and pixel format
* Current preexposure of the color pixel format to diagnose pre-exposure problems and also specify if it is overriden with r.EyeAdaptation.PreExposureOverride

#rb jeremy.moore
#jira UE-181976
#preflight 642ed1911d61ecec3be79488

[CL 24947424 by Guillaume Abadie in ue5-main branch]
2023-04-06 13:15:46 -04:00

80 lines
2.4 KiB
C

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "OverridePassSequence.h"
// Returns whether the gbuffer visualization pass needs to render on screen.
bool IsVisualizeGBufferOverviewEnabled(const FViewInfo& View);
// Returns whether the gubffer visualization pass needs to dump targets to files.
bool IsVisualizeGBufferDumpToFileEnabled(const FViewInfo& View);
// Returns whether the gbuffer visualization pass needs to dump to a pipe.
bool IsVisualizeGBufferDumpToPipeEnabled(const FViewInfo& View);
// Returns whether the gbuffer visualization pass should output in floating point format.
bool IsVisualizeGBufferInFloatFormat();
struct FVisualizeGBufferOverviewInputs
{
FScreenPassRenderTarget OverrideOutput;
// The current scene color being processed.
FScreenPassTexture SceneColor;
// The HDR scene color immediately before tonemapping is applied.
FScreenPassTexture SceneColorBeforeTonemap;
// The scene color immediately after tonemapping is applied.
FScreenPassTexture SceneColorAfterTonemap;
// The separate translucency texture to composite.
FScreenPassTexture SeparateTranslucency;
// The original scene velocity texture to composite.
FScreenPassTexture Velocity;
/** The uniform buffer containing all scene textures. */
FSceneTextureShaderParameters SceneTextures;
/** The path tracing intermediate textures. */
const struct FPathTracingResources* PathTracingResources = nullptr;
// Dump targets to files on disk.
bool bDumpToFile = false;
// Render an overview of the GBuffer targets.
bool bOverview = false;
// Whether to emit outputs in HDR.
bool bOutputInHDR = false;
};
FScreenPassTexture AddVisualizeGBufferOverviewPass(FRDGBuilder& GraphBuilder, const FViewInfo& View, const FVisualizeGBufferOverviewInputs& Inputs);
struct FVisualizeBufferTile
{
// The input texture to visualize.
FScreenPassTexture Input;
// The label of the tile shown on the visualizer.
FString Label;
// Whether the tile is shown as selected.
bool bSelected = false;
};
struct FVisualizeBufferInputs
{
FScreenPassRenderTarget OverrideOutput;
// The scene color input to propagate.
FScreenPassTexture SceneColor;
// The array of tiles to render onto the scene color texture.
TArrayView<const FVisualizeBufferTile> Tiles;
};
FScreenPassTexture AddVisualizeBufferPass(FRDGBuilder& GraphBuilder, const FViewInfo& View, const FVisualizeBufferInputs& Inputs);