Exemplo n.º 1
0
        private void Init()
        {
            if (m_Initialized)
            {
                return;
            }

            m_DepthOnlyPass                       = new DepthOnlyPass();
            m_MainLightShadowCasterPass           = new MainLightShadowCasterPass();
            m_AdditionalLightsShadowCasterPass    = new AdditionalLightsShadowCasterPass();
            m_SetupForwardRenderingPass           = new SetupForwardRenderingPass();
            m_ScreenSpaceShadowResolvePass        = new ScreenSpaceShadowResolvePass();
            m_CreateLightweightRenderTexturesPass = new CreateLightweightRenderTexturesPass();
            m_BeginXrRenderingPass                = new BeginXRRenderingPass();
            m_SetupLightweightConstants           = new SetupLightweightConstanstPass();
            m_RenderOpaqueForwardPass             = new RenderOpaqueForwardPass();
            m_OpaquePostProcessPass               = new OpaquePostProcessPass();
            m_DrawSkyboxPass                      = new DrawSkyboxPass();
            m_CopyDepthPass                       = new CopyDepthPass();
            m_CopyColorPass                       = new CopyColorPass();
            m_CopyRenderedPass                    = new CopyRenderedPass();
            m_CopyToRenderTexturePass             = new CopyToRenderTexturePass();
            m_RenderTransparentForwardPass        = new RenderTransparentForwardPass();
            m_TransparentPostProcessPass          = new TransparentPostProcessPass();
            m_FinalBlitPass                       = new FinalBlitPass();
            m_EndXrRenderingPass                  = new EndXRRenderingPass();

#if UNITY_EDITOR
            m_SceneViewDepthCopyPass = new SceneViewDepthCopyPass();
#endif

            // RenderTexture format depends on camera and pipeline (HDR, non HDR, etc)
            // Samples (MSAA) depend on camera and pipeline
            ColorAttachment.Init("_CameraColorTexture");
            DepthAttachment.Init("_CameraDepthAttachment");
            ColorCopyIntermediateHandle.Init("_ColorCopyIntermediate");
            DepthTexture.Init("_CameraDepthTexture");
            OpaqueColor.Init("_CameraOpaqueTexture");
            RenderedColor.Init("_CameraRenderedTexture");
            MainLightShadowmap.Init("_MainLightShadowmapTexture");
            AdditionalLightsShadowmap.Init("_AdditionalLightsShadowmapTexture");
            ScreenSpaceShadowmap.Init("_ScreenSpaceShadowmapTexture");

            m_Initialized = true;
        }
Exemplo n.º 2
0
        private void Init(LightweightForwardRenderer renderer)
        {
            if (m_Initialized)
            {
                return;
            }

            m_DepthOnlyPass                       = new DepthOnlyPass(renderer);
            m_DirectionalShadowPass               = new DirectionalShadowsPass(renderer);
            m_LocalShadowPass                     = new LocalShadowsPass(renderer);
            m_SetupForwardRenderingPass           = new SetupForwardRenderingPass(renderer);
            m_ScreenSpaceShadowResovePass         = new ScreenSpaceShadowResolvePass(renderer);
            m_CreateLightweightRenderTexturesPass = new CreateLightweightRenderTexturesPass(renderer);
            m_BeginXrRenderingPass                = new BeginXRRenderingPass(renderer);
            m_SetupLightweightConstants           = new SetupLightweightConstanstPass(renderer);
            m_RenderOpaqueForwardPass             = new RenderOpaqueForwardPass(renderer);
            m_OpaquePostProcessPass               = new OpaquePostProcessPass(renderer);
            m_DrawSkyboxPass                      = new DrawSkyboxPass(renderer);
            m_CopyDepthPass                       = new CopyDepthPass(renderer);
            m_CopyColorPass                       = new CopyColorPass(renderer);
            m_RenderTransparentForwardPass        = new RenderTransparentForwardPass(renderer);
            m_TransparentPostProcessPass          = new TransparentPostProcessPass(renderer);
            m_FinalBlitPass                       = new FinalBlitPass(renderer);
            m_EndXrRenderingPass                  = new EndXRRenderingPass(renderer);

            #if UNITY_EDITOR
            m_SceneViewDepthCopyPass = new SceneViewDepthCopyPass(renderer);
            #endif

            // RenderTexture format depends on camera and pipeline (HDR, non HDR, etc)
            // Samples (MSAA) depend on camera and pipeline
            Color.Init("_CameraColorTexture");
            DepthAttachment.Init("_CameraDepthAttachment");
            DepthTexture.Init("_CameraDepthTexture");
            OpaqueColor.Init("_CameraOpaqueTexture");
            DirectionalShadowmap.Init("_DirectionalShadowmapTexture");
            LocalShadowmap.Init("_LocalShadowmapTexture");
            ScreenSpaceShadowmap.Init("_ScreenSpaceShadowMapTexture");

            m_Initialized = true;
        }