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-09-03 19:19:28 -04:00
|
|
|
#include "ScreenPass.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2019-10-01 13:03:04 -04:00
|
|
|
class FSceneDownsampleChain;
|
|
|
|
|
|
2019-09-03 19:19:28 -04:00
|
|
|
enum class ELensFlareQuality : uint32
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2019-09-03 19:19:28 -04:00
|
|
|
Disabled,
|
|
|
|
|
Low,
|
|
|
|
|
High,
|
2019-09-05 22:45:28 -04:00
|
|
|
VeryHigh,
|
2019-09-03 19:19:28 -04:00
|
|
|
MAX
|
2014-03-14 14:13:41 -04:00
|
|
|
};
|
2019-09-03 19:19:28 -04:00
|
|
|
|
|
|
|
|
ELensFlareQuality GetLensFlareQuality();
|
|
|
|
|
|
|
|
|
|
struct FLensFlareInputs
|
|
|
|
|
{
|
|
|
|
|
static const uint32 LensFlareCountMax = 8;
|
|
|
|
|
|
|
|
|
|
// [Required] The bloom convolution texture. If enabled, this will be composited with lens flares. Otherwise,
|
|
|
|
|
// a transparent black texture is used instead. Either way, the final output texture will use the this texture
|
|
|
|
|
// descriptor and viewport.
|
2019-10-01 13:03:04 -04:00
|
|
|
FScreenPassTexture Bloom;
|
2019-09-03 19:19:28 -04:00
|
|
|
|
|
|
|
|
// [Required] The scene color input, before bloom, which is used as the source of lens flares.
|
|
|
|
|
// This can be a downsampled input based on the desired quality level.
|
2019-10-01 13:03:04 -04:00
|
|
|
FScreenPassTexture Flare;
|
2019-09-03 19:19:28 -04:00
|
|
|
|
|
|
|
|
// [Required] The bokeh shape texture to use to blur the lens flares.
|
2019-10-01 13:03:04 -04:00
|
|
|
FRHITexture* BokehShapeTexture;
|
2019-09-03 19:19:28 -04:00
|
|
|
|
|
|
|
|
// The number of lens flares to render.
|
|
|
|
|
uint32 LensFlareCount = LensFlareCountMax;
|
|
|
|
|
|
|
|
|
|
// The array of per-flare tint colors. Length must be equal to LensFlareCount.
|
|
|
|
|
TArrayView<const FLinearColor> TintColorsPerFlare;
|
|
|
|
|
|
|
|
|
|
// The lens flare tint color to apply to all lens flares.
|
|
|
|
|
FLinearColor TintColor;
|
|
|
|
|
|
|
|
|
|
// The size of the bokeh shape in screen percentage.
|
|
|
|
|
float BokehSizePercent = 0.0f;
|
|
|
|
|
|
|
|
|
|
// Brightness scale of the lens flares.
|
|
|
|
|
float Intensity = 1.0f;
|
|
|
|
|
|
|
|
|
|
// Brightness threshold at which lens flares begin having an effect.
|
|
|
|
|
float Threshold = 1.0f;
|
|
|
|
|
|
|
|
|
|
// Whether to composite lens flares with the scene color input. If false, the result is composited on transparent black.
|
|
|
|
|
bool bCompositeWithBloom = true;
|
|
|
|
|
};
|
|
|
|
|
|
2019-10-01 13:03:04 -04:00
|
|
|
using FLensFlareOutputs = FScreenPassTexture;
|
|
|
|
|
|
|
|
|
|
FLensFlareOutputs AddLensFlaresPass(FRDGBuilder& GraphBuilder, const FViewInfo& View, const FLensFlareInputs& Inputs);
|
|
|
|
|
|
|
|
|
|
// Helper function which pulls inputs from the post process settings of the view.
|
|
|
|
|
FScreenPassTexture AddLensFlaresPass(
|
|
|
|
|
FRDGBuilder& GraphBuilder,
|
|
|
|
|
const FViewInfo& View,
|
|
|
|
|
FScreenPassTexture Bloom,
|
|
|
|
|
const FSceneDownsampleChain& SceneDownsampleChain);
|