Files
UnrealEngineUWP/Engine/Source/Runtime/Renderer/Private/FXRenderingUtils.cpp
daniel wright cefd739201 Lumen Front Layer Translucency Reflections - provides mirror reflections on translucent surfaces
* When enabled, translucent surfaces are rasterized again to create a minimal translucency GBuffer, using depth writes and tests to only capture the frontmost layer
 * Lumen Reflections are run on the translucency GBuffer, without denoising to reduce overhead (forced to mirror)
 * Finally the translucent base pass depth-tests against the frontmost layer depth and applies the high quality reflections.  Subsequent layers continue to use the Radiance Cache based reflections.
 * Disabled by default due the constant overheads when any translucent surface is on-screen
 * New Post Process Volume and Project setting to enable

#ROBOMERGE-AUTHOR: daniel.wright
#ROBOMERGE-SOURCE: CL 19387917 via CL 19387985
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19391295 by daniel wright in ue5-main branch]
2022-03-15 15:08:58 -04:00

32 lines
1.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "FXRenderingUtils.h"
#include "MaterialShared.h"
#include "Lumen/LumenScreenProbeGather.h"
bool FFXRenderingUtils::CanMaterialRenderBeforeFXPostOpaque(
const FSceneViewFamily& ViewFamily,
const FPrimitiveSceneProxy& SceneProxy,
const FMaterial& Material)
{
const EBlendMode BlendMode = Material.GetBlendMode();
const bool bTranslucent = IsTranslucentBlendMode(BlendMode);
if (!bTranslucent)
{
// opaque materials always render before FFXSystemInterface::PostOpaqueRender
return true;
}
// When rendering Lumen, it's possible a translucent material might render in the LumenTranslucencyRadianceCacheMark pass,
// which happens before PostRenderOpaque.
const FScene* Scene = SceneProxy.GetScene().GetRenderScene();
if (Scene
&& (CanMaterialRenderInLumenTranslucencyRadianceCacheMarkPass(*Scene, ViewFamily, SceneProxy, Material)
|| CanMaterialRenderInLumenFrontLayerTranslucencyGBufferPass(*Scene, ViewFamily, SceneProxy, Material)))
{
return true;
}
return false;
}