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

            m_DepthOnlyPass                       = new DepthOnlyPass();
            _CopyDepthForOITPass                  = new CopyDepthPass();
            _OITDepthOnlyPass                     = new OITDepthOnlyPass();
            m_DepthNormalsPass                    = new DepthNormalsPass();
            m_MainLightShadowCasterPass           = new MainLightShadowCasterPass();
            m_MainCharacterShadowCasterPass       = new MainCharacterShadowCasterPass();
            m_AdditionalLightsShadowCasterPass    = new AdditionalLightsShadowCasterPass();
            _DeepShadowCasterPass                 = new DeepShadowCasterPass();
            m_SetupForwardRenderingPass           = new SetupForwardRenderingPass();
            m_ScreenSpaceShadowResolvePass        = new ScreenSpaceShadowResolvePass();
            _ScreenSpaceDeepShadowMapsPass        = new ScreenSpaceDeepShadowMapsPass();
            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_RenderTransparentForwardPass        = new RenderTransparentForwardPass();
            //_RenderWeightedOITForwardPass = new RenderWeightedOITForwardPass();
            _RenderMomentOITForwardPass  = new RenderMomentOITForwardPass();
            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");
            DepthTexture.Init("_CameraDepthTexture");
            OITDepthTexture.Init("_OITDepthTexture");
            OpaqueColor.Init("_CameraOpaqueTexture");
            DepthNormalsTexture.Init("_CameraDepthNormalsTexture");
            MainLightShadowmap.Init("_MainLightShadowmapTexture");
            MainCharacterShadowmap.Init("_MainCharacterShadowmapTexture");
            AdditionalLightsShadowmap.Init("_AdditionalLightsShadowmapTexture");
            ScreenSpaceShadowmap.Init("_ScreenSpaceShadowmapTexture");
            ScreenSpaceDeepShadowLut.Init("_DeepShadowLut");

            m_Initialized = true;
        }
        private void Init()
        {
            if (m_Initialized)
            {
                return;
            }

            m_DepthOnlyPass                       = new DepthOnlyPass();
            m_DirectionalShadowPass               = new DirectionalShadowsPass();
            m_LocalShadowPass                     = new LocalShadowsPass();
            m_SetupForwardRenderingPass           = new SetupForwardRenderingPass();
            m_ScreenSpaceShadowResovePass         = 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_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
            Color.Init("_CameraColorTexture");
            DepthAttachment.Init("_CameraDepthAttachment");
            DepthTexture.Init("_CameraDepthTexture");
            OpaqueColor.Init("_CameraOpaqueTexture");
            DirectionalShadowmap.Init("_DirectionalShadowmapTexture");
            LocalShadowmap.Init("_LocalShadowmapTexture");
            ScreenSpaceShadowmap.Init("_ScreenSpaceShadowMapTexture");

            m_Initialized = true;
        }