2019-12-26 14:45:42 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
#include "ScreenPass.h"
|
2020-09-24 00:43:27 -04:00
|
|
|
#include "TranslucentRendering.h"
|
2020-10-20 11:36:46 -04:00
|
|
|
#include "SystemTextures.h"
|
2020-10-20 11:55:33 -04:00
|
|
|
#include "ScenePrivate.h"
|
2019-10-01 13:03:04 -04:00
|
|
|
|
|
|
|
|
class FSceneTextureParameters;
|
|
|
|
|
|
2020-07-06 18:58:26 -04:00
|
|
|
namespace Nanite
|
|
|
|
|
{
|
|
|
|
|
struct FRasterResults;
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-01 13:03:04 -04:00
|
|
|
enum class EPostProcessAAQuality : uint32
|
|
|
|
|
{
|
|
|
|
|
Disabled,
|
|
|
|
|
// Faster FXAA
|
|
|
|
|
VeryLow,
|
|
|
|
|
// FXAA
|
|
|
|
|
Low,
|
|
|
|
|
// Faster Temporal AA
|
|
|
|
|
Medium,
|
|
|
|
|
// Temporal AA
|
|
|
|
|
High,
|
|
|
|
|
VeryHigh,
|
|
|
|
|
MAX
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Returns the quality of post process anti-aliasing defined by CVar.
|
|
|
|
|
EPostProcessAAQuality GetPostProcessAAQuality();
|
|
|
|
|
|
|
|
|
|
// Returns whether the full post process pipeline is enabled. Otherwise, the minimal set of operations are performed.
|
|
|
|
|
bool IsPostProcessingEnabled(const FViewInfo& View);
|
|
|
|
|
|
|
|
|
|
// Returns whether the post process pipeline supports using compute passes.
|
|
|
|
|
bool IsPostProcessingWithComputeEnabled(ERHIFeatureLevel::Type FeatureLevel);
|
|
|
|
|
|
|
|
|
|
// Returns whether the post process pipeline supports propagating the alpha channel.
|
|
|
|
|
bool IsPostProcessingWithAlphaChannelSupported();
|
|
|
|
|
|
2020-10-20 11:36:46 -04:00
|
|
|
using FPostProcessVS = FScreenPassVS;
|
|
|
|
|
|
2019-10-01 13:03:04 -04:00
|
|
|
struct FPostProcessingInputs
|
|
|
|
|
{
|
2020-09-24 00:43:27 -04:00
|
|
|
TRDGUniformBufferRef<FSceneTextureUniformParameters> SceneTextures = nullptr;
|
2019-10-01 13:03:04 -04:00
|
|
|
FRDGTextureRef ViewFamilyTexture = nullptr;
|
2021-04-30 13:02:00 -04:00
|
|
|
FRDGTextureRef CustomDepthTexture = nullptr;
|
2020-09-24 00:43:27 -04:00
|
|
|
const FSeparateTranslucencyTextures* SeparateTranslucencyTextures = nullptr;
|
2019-10-01 13:03:04 -04:00
|
|
|
|
|
|
|
|
void Validate() const
|
|
|
|
|
{
|
|
|
|
|
check(SceneTextures);
|
2020-09-24 00:43:27 -04:00
|
|
|
check(ViewFamilyTexture);
|
2021-04-30 13:02:00 -04:00
|
|
|
check(CustomDepthTexture);
|
2020-09-24 00:43:27 -04:00
|
|
|
check(SeparateTranslucencyTextures);
|
2019-10-01 13:03:04 -04:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2021-01-14 05:23:34 -04:00
|
|
|
void AddPostProcessingPasses(FRDGBuilder& GraphBuilder, const FViewInfo& View, const FPostProcessingInputs& Inputs, const Nanite::FRasterResults* NaniteRasterResults, FInstanceCullingManager& InstanceCullingManager);
|
2019-10-01 13:03:04 -04:00
|
|
|
|
2020-07-06 18:58:26 -04:00
|
|
|
void AddDebugViewPostProcessingPasses(FRDGBuilder& GraphBuilder, const FViewInfo& View, const FPostProcessingInputs& Inputs, const Nanite::FRasterResults* NaniteRasterResults);
|
2020-04-28 12:42:51 -04:00
|
|
|
|
2020-05-01 14:17:49 -04:00
|
|
|
#if !(UE_BUILD_SHIPPING)
|
2020-04-28 12:42:51 -04:00
|
|
|
|
2020-05-01 14:17:49 -04:00
|
|
|
void AddVisualizeCalibrationMaterialPostProcessingPasses(FRDGBuilder& GraphBuilder, const FViewInfo& View, const FPostProcessingInputs& Inputs, const UMaterialInterface* InMaterialInterface);
|
2020-04-28 12:42:51 -04:00
|
|
|
|
|
|
|
|
#endif
|
2019-06-11 18:27:07 -04:00
|
|
|
|
2020-09-24 00:43:27 -04:00
|
|
|
|
|
|
|
|
struct FMobilePostProcessingInputs
|
|
|
|
|
{
|
|
|
|
|
TRDGUniformBufferRef<FMobileSceneTextureUniformParameters> SceneTextures = nullptr;
|
|
|
|
|
FRDGTextureRef ViewFamilyTexture = nullptr;
|
|
|
|
|
|
|
|
|
|
void Validate() const
|
|
|
|
|
{
|
|
|
|
|
check(ViewFamilyTexture);
|
|
|
|
|
check(SceneTextures);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2021-03-22 22:21:46 -04:00
|
|
|
void AddMobilePostProcessingPasses(FRDGBuilder& GraphBuilder, FScene* Scene, const FViewInfo& View, const FMobilePostProcessingInputs& Inputs, FInstanceCullingManager& InstanceCullingManager);
|
2020-09-24 00:43:27 -04:00
|
|
|
|
|
|
|
|
void AddBasicPostProcessPasses(FRDGBuilder& GraphBuilder, const FViewInfo& View);
|
|
|
|
|
|
2020-11-12 13:39:39 -04:00
|
|
|
FRDGTextureRef AddProcessPlanarReflectionPass(FRDGBuilder& GraphBuilder, const FViewInfo& View, FRDGTextureRef SceneColorTexture);
|