55 lines
1.5 KiB
C#
55 lines
1.5 KiB
C#
using XCEngine;
|
|
using XCEngine.Rendering;
|
|
|
|
namespace XCEngine.Rendering.Universal
|
|
{
|
|
internal sealed class UniversalFinalOutputBlock
|
|
{
|
|
private readonly BuiltinFinalColorPass m_builtinFinalColorPass =
|
|
new BuiltinFinalColorPass();
|
|
|
|
public void FinalizeCameraFramePlan(
|
|
ScriptableRenderPipelinePlanningContext context,
|
|
UniversalPostProcessBlock postProcessBlock)
|
|
{
|
|
if (context == null ||
|
|
!context.HasFinalColorProcessing())
|
|
{
|
|
return;
|
|
}
|
|
|
|
context.ClearFullscreenStage(
|
|
CameraFrameStage.FinalOutput);
|
|
|
|
CameraFrameColorSource finalOutputSource =
|
|
postProcessBlock != null
|
|
? postProcessBlock.ResolveFinalOutputSource(
|
|
context)
|
|
: CameraFrameColorSource.MainSceneColor;
|
|
|
|
context.RequestFullscreenStage(
|
|
CameraFrameStage.FinalOutput,
|
|
finalOutputSource);
|
|
}
|
|
|
|
public void EnqueueRenderPasses(
|
|
ScriptableRenderer renderer,
|
|
RenderingData renderingData)
|
|
{
|
|
if (renderer == null ||
|
|
renderingData == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (!renderingData.isFinalOutputStage &&
|
|
!renderingData.finalColorData.requiresProcessing)
|
|
{
|
|
return;
|
|
}
|
|
|
|
renderer.EnqueuePass(m_builtinFinalColorPass);
|
|
}
|
|
}
|
|
}
|