浏览代码

updated BoatAttack to use internal UniversalRP API.

/demo-work-customrenderer
Felipe Lira 5 年前
当前提交
fb4965c8
共有 1 个文件被更改,包括 3 次插入10 次删除
  1. 13
      Assets/Rendering/BoatRenderer.cs

13
Assets/Rendering/BoatRenderer.cs


using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using UnityEngine.Rendering.Universal.Internal;
public class BoatRenderer : ScriptableRenderer
{

FinalBlitPass m_FinalBlitPass;
CopyColorPass m_CopyColorPass;
DrawObjectsPass m_RenderTransparentForwardPass;
#if UNITY_EDITOR
SceneViewDepthCopyPass m_SceneViewDepthCopyPass;
#endif
RenderTargetHandle m_ActiveCameraColorAttachment;
RenderTargetHandle m_ActiveCameraDepthAttachment;

m_FinalBlitPass = new FinalBlitPass(RenderPassEvent.AfterRendering, blitMaterial);
m_CopyColorPass = new CopyColorPass(RenderPassEvent.BeforeRenderingTransparents, samplingMaterial);
m_RenderTransparentForwardPass = new DrawObjectsPass("Render Transparents", false, RenderPassEvent.BeforeRenderingTransparents, RenderQueueRange.transparent, -1, StencilState.defaultValue, 0);
#if UNITY_EDITOR
m_SceneViewDepthCopyPass = new SceneViewDepthCopyPass(RenderPassEvent.AfterRendering + 9, copyDepthMaterial);
#endif
// RenderTexture format depends on camera and pipeline (HDR, non HDR, etc)
// Samples (MSAA) depend on camera and pipeline

{
if (requiresFinalPostProcessPass)
{
m_PostProcessPass.Setup(cameraTargetDescriptor, m_ActiveCameraColorAttachment, m_AfterPostProcessColor, m_ActiveCameraDepthAttachment, m_ColorGradingLut);
m_PostProcessPass.Setup(cameraTargetDescriptor, m_ActiveCameraColorAttachment, m_AfterPostProcessColor, m_ActiveCameraDepthAttachment, m_ColorGradingLut, true);
EnqueuePass(m_PostProcessPass);
m_FinalPostProcessPass.SetupFinalPass(m_AfterPostProcessColor);
EnqueuePass(m_FinalPostProcessPass);

m_PostProcessPass.Setup(cameraTargetDescriptor, m_ActiveCameraColorAttachment, RenderTargetHandle.CameraTarget, m_ActiveCameraDepthAttachment, m_ColorGradingLut);
m_PostProcessPass.Setup(cameraTargetDescriptor, m_ActiveCameraColorAttachment, RenderTargetHandle.CameraTarget, m_ActiveCameraDepthAttachment, m_ColorGradingLut, false);
EnqueuePass(m_PostProcessPass);
}
}

正在加载...
取消
保存