public override void AddRenderPasses(ScriptableRenderer renderer,
                                             ref RenderingData renderingData)
        {
            var tis = GetTIS(renderingData.cameraData.camera);

            if (tis == null || !tis.shouldUpdateBlur())
            {
                return;
            }

            blurAlgorithm.Init(tis.BlurConfig);
            var passData = new TISPassData {
                cameraColorTarget = renderer.cameraColorTarget,
                blurAlgorithm     = blurAlgorithm, //hack for now
                blurSource        = tis,
                isPreviewing      = tis.preview
            };

            bool requiresFinalPostProcessPass = renderingData.cameraData.postProcessEnabled &&
                                                renderingData.cameraData.antialiasing ==
                                                AntialiasingMode.FastApproximateAntialiasing;

            pass.renderPassEvent = requiresFinalPostProcessPass
                              ? RenderPassEvent.AfterRenderingPostProcessing
                              : RenderPassEvent.AfterRendering;

            pass.Setup(passData);

            renderer.EnqueuePass(pass);
        }
コード例 #2
0
        void InitializeBlurAlgorithm()
        {
            switch (blurAlgorithmSelection)
            {
            case BlurAlgorithmType.ScalableBlur:
                blurAlgorithm = new ScalableBlur();
                break;

            default:
                throw new ArgumentOutOfRangeException("BlurAlgorithmSelection");
            }

            blurAlgorithm.Init(BlurConfig);
        }
コード例 #3
0
        public override void AddRenderPasses(ScriptableRenderer renderer,
                                             ref RenderingData renderingData)
        {
            var tis = GetTIS(renderingData.cameraData.camera);

            if (tis == null || !tis.shouldUpdateBlur())
            {
                return;
            }

            tis.OnBeforeBlur();
            blurAlgorithm.Init(tis.BlurConfig);
            var passData = new TISPassData {
                cameraColorTarget = renderer.cameraColorTarget,
                blurAlgorithm     = blurAlgorithm, //hack for now
                blurSource        = tis,
                isPreviewing      = tis.preview
            };

            pass.Setup(passData);

            renderer.EnqueuePass(pass);
        }