You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb none #jira none #preflight 61ae42868358693a22c276d0 #ROBOMERGE-AUTHOR: guillaume.abadie #ROBOMERGE-SOURCE: CL 18385314 in //UE5/Release-5.0/... via CL 18385332 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v896-18170469) [CL 18385358 by guillaume abadie in ue5-release-engine-test branch]
96 lines
2.3 KiB
C++
96 lines
2.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "ScreenPass.h"
|
|
|
|
class FEyeAdaptationParameters;
|
|
|
|
enum class EDownsampleFlags : uint8
|
|
{
|
|
None = 0,
|
|
|
|
// Forces the downsample pass to run on the raster pipeline, regardless of view settings.
|
|
ForceRaster = 0x1
|
|
};
|
|
ENUM_CLASS_FLAGS(EDownsampleFlags);
|
|
|
|
enum class EDownsampleQuality : uint8
|
|
{
|
|
// Single filtered sample (2x2 tap).
|
|
Low,
|
|
|
|
// Four filtered samples (4x4 tap).
|
|
High,
|
|
|
|
MAX
|
|
};
|
|
|
|
// The set of inputs needed to add a downsample pass to RDG.
|
|
struct FDownsamplePassInputs
|
|
{
|
|
FDownsamplePassInputs() = default;
|
|
|
|
// Friendly name of the pass. Used for logging and profiling.
|
|
const TCHAR* Name = nullptr;
|
|
|
|
// Optional user supplied output buffer.
|
|
IPooledRenderTarget* UserSuppliedOutput = nullptr;
|
|
|
|
// Input scene color RDG texture / view rect. Must not be null.
|
|
FScreenPassTexture SceneColor;
|
|
|
|
// The downsample method to use.
|
|
EDownsampleQuality Quality = EDownsampleQuality::Low;
|
|
|
|
// Flags to control how the downsample pass is run.
|
|
EDownsampleFlags Flags = EDownsampleFlags::None;
|
|
|
|
// The format to use for the output texture (if unknown, the input format is used).
|
|
EPixelFormat FormatOverride = PF_Unknown;
|
|
};
|
|
|
|
FScreenPassTexture AddDownsamplePass(FRDGBuilder& GraphBuilder, const FViewInfo& View, const FDownsamplePassInputs& Inputs);
|
|
|
|
void AddDownsampleComputePass(FRDGBuilder& GraphBuilder, const FViewInfo& View, FScreenPassTexture Input, FScreenPassTexture Output, EDownsampleQuality Quality, ERDGPassFlags PassFlags);
|
|
|
|
class FSceneDownsampleChain
|
|
{
|
|
public:
|
|
// The number of total stages in the chain. 1/64 reduction.
|
|
static const uint32 StageCount = 6;
|
|
|
|
FSceneDownsampleChain() = default;
|
|
|
|
void Init(
|
|
FRDGBuilder& GraphBuilder,
|
|
const FViewInfo& View,
|
|
const FEyeAdaptationParameters& EyeAdaptationParameters,
|
|
FScreenPassTexture HalfResolutionSceneColor,
|
|
EDownsampleQuality DownsampleQuality,
|
|
bool bLogLumaInAlpha);
|
|
|
|
bool IsInitialized() const
|
|
{
|
|
return bInitialized;
|
|
}
|
|
|
|
FScreenPassTexture GetTexture(uint32 StageIndex) const
|
|
{
|
|
return Textures[StageIndex];
|
|
}
|
|
|
|
FScreenPassTexture GetFirstTexture() const
|
|
{
|
|
return Textures[0];
|
|
}
|
|
|
|
FScreenPassTexture GetLastTexture() const
|
|
{
|
|
return Textures[StageCount - 1];
|
|
}
|
|
|
|
private:
|
|
TStaticArray<FScreenPassTexture, StageCount> Textures;
|
|
bool bInitialized = false;
|
|
}; |