public CustomURPRender(CustomURPRenderDataAsset data) : base(data) { m_targetCustomURPRenderDataAsset = data; m_cameraColorAttachment.Init("_CameraColorTexture"); m_cameraDepthAttachment.Init("_CameraDepthAttachment"); Material blitMaterial = CoreUtils.CreateEngineMaterial(data.blitShader); m_opaqueObjectPass = new DrawObjectsPass("Render Opaques", true, UnityEngine.Rendering.Universal.RenderPassEvent.BeforeRenderingOpaques, RenderQueueRange.opaque, -1, StencilState.defaultValue, 0); m_transparentObjectPass = new DrawObjectsPass("Render Transparents", false, RenderPassEvent.BeforeRenderingTransparents, RenderQueueRange.transparent, -1, StencilState.defaultValue, 0); m_finalBlitPass = new FinalBlitPass(RenderPassEvent.AfterRendering, blitMaterial); m_drawSkyBoxPass = new DissolveSkyBoxPass(RenderPassEvent.BeforeRenderingSkybox, this); m_clearDepthWhenRenderCameraStackPass = new ClearDepthWhenRenderCameraStackPass(); //setup reference rendering feature for support camera stacking. supportedRenderingFeatures = new RenderingFeatures() { cameraStacking = true, }; }
public ForwardRenderer(ForwardRendererData data) : base(data) { Material blitMaterial = CoreUtils.CreateEngineMaterial(data.shaders.blitPS); Material copyDepthMaterial = CoreUtils.CreateEngineMaterial(data.shaders.copyDepthPS); Material samplingMaterial = CoreUtils.CreateEngineMaterial(data.shaders.samplingPS); Material screenspaceShadowsMaterial = CoreUtils.CreateEngineMaterial(data.shaders.screenSpaceShadowPS); StencilStateData stencilData = data.defaultStencilState; m_DefaultStencilState = StencilState.defaultValue; m_DefaultStencilState.enabled = stencilData.overrideStencilState; m_DefaultStencilState.SetCompareFunction(stencilData.stencilCompareFunction); m_DefaultStencilState.SetPassOperation(stencilData.passOperation); m_DefaultStencilState.SetFailOperation(stencilData.failOperation); m_DefaultStencilState.SetZFailOperation(stencilData.zFailOperation); // Note: Since all custom render passes inject first and we have stable sort, // we inject the builtin passes in the before events. m_VolumeBlendingPass = new VolumeBlendingPass(RenderPassEvent.BeforeRendering); m_MainLightShadowCasterPass = new MainLightShadowCasterPass(RenderPassEvent.BeforeRenderingShadows); m_AdditionalLightsShadowCasterPass = new AdditionalLightsShadowCasterPass(RenderPassEvent.BeforeRenderingShadows); m_DepthPrepass = new DepthOnlyPass(RenderPassEvent.BeforeRenderingPrepasses, RenderQueueRange.opaque, data.opaqueLayerMask); m_ScreenSpaceShadowResolvePass = new ScreenSpaceShadowResolvePass(RenderPassEvent.BeforeRenderingPrepasses, screenspaceShadowsMaterial); m_ColorGradingLutPass = new ColorGradingLutPass(RenderPassEvent.BeforeRenderingOpaques, data.postProcessData); m_RenderOpaqueForwardPass = new DrawObjectsPass("Render Opaques", true, RenderPassEvent.BeforeRenderingOpaques, RenderQueueRange.opaque, data.opaqueLayerMask, m_DefaultStencilState, stencilData.stencilReference); m_CopyDepthPass = new CopyDepthPass(RenderPassEvent.BeforeRenderingOpaques, copyDepthMaterial); m_DrawSkyboxPass = new DrawSkyboxPass(RenderPassEvent.BeforeRenderingSkybox); m_CopyColorPass = new CopyColorPass(RenderPassEvent.BeforeRenderingTransparents, samplingMaterial); m_RenderTransparentForwardPass = new DrawObjectsPass("Render Transparents", false, RenderPassEvent.BeforeRenderingTransparents, RenderQueueRange.transparent, data.transparentLayerMask, m_DefaultStencilState, stencilData.stencilReference); m_PostProcessPass = new PostProcessPass(RenderPassEvent.BeforeRenderingPostProcessing, data.postProcessData); m_FinalPostProcessPass = new PostProcessPass(RenderPassEvent.AfterRenderingPostProcessing, data.postProcessData); m_CapturePass = new CapturePass(RenderPassEvent.AfterRendering); m_FinalBlitPass = new FinalBlitPass(RenderPassEvent.AfterRendering, blitMaterial); #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 m_CameraColorAttachment.Init("_CameraColorTexture"); m_CameraDepthAttachment.Init("_CameraDepthAttachment"); m_DepthTexture.Init("_CameraDepthTexture"); m_OpaqueColor.Init("_CameraOpaqueTexture"); m_AfterPostProcessColor.Init("_AfterPostProcessTexture"); m_ColorGradingLut.Init("_InternalGradingLut"); m_ForwardLights = new ForwardLights(); }
public CustomLWPipe(CustomRenderGraphData data) : base(data) { m_RenderOpaqueForwardPass = new DrawObjectsPass("Render Opaques", true, RenderPassEvent.BeforeRenderingOpaques + 1, RenderQueueRange.opaque, -1, StencilState.defaultValue, 0); m_ForwardLights = new ForwardLights(); }