コード例 #1
0
        public void DispatchToRenderStage(IBlurStageModel stage, CommandList cl, RenderCommandQueueItem command)
        {
            var surface = _surfaceManager.RetrieveSurface(command.Surface, new GpuSurfaceType[] { GpuSurfaceType.Texture, GpuSurfaceType.Internal });
            var source  = _surfaceManager.RetrieveSurface(command.Texture0, new GpuSurfaceType[] { GpuSurfaceType.SwapChainOutput, GpuSurfaceType.Internal });

            _blur2DEffectStageRenderer.Render(cl, stage, source, surface);
        }
コード例 #2
0
ファイル: BlurStageRenderer.cs プロジェクト: limocute/yak2d
        public void Render(CommandList cl, IBlurStageModel stage, GpuSurface source, GpuSurface target)
        {
            if (cl == null || stage == null || source == null || target == null)
            {
                _frameworkMessenger.Report("Warning: you are feeding the Blur2D Stage Renderer null inputs, aborting");
                return;
            }

            //Downsample
            _blurSamplingRenderer.Render(cl, source, stage.LinearSampledSurface0, stage.SampleType);

            //Blur Horizontally
            _singlePassGaussianBlurRenderer.Render(cl, new Vector2(stage.TexelShiftSize.X, 0.0f), stage.NumberSamples, stage.LinearSampledSurface0, stage.LinearSampledSurface1);

            //Blur Vertically
            _singlePassGaussianBlurRenderer.Render(cl, new Vector2(0.0f, stage.TexelShiftSize.Y), stage.NumberSamples, stage.LinearSampledSurface1, stage.AnistropicallySampledSurface);

            //Mix
            _blur2DResultMixingRenderer.Render(cl, stage.MixAmount, source, stage.AnistropicallySampledSurface, target);
        }
コード例 #3
0
 public void CacheStageModel(IBlurStageModel model) => CachedBlur2dEffectModel                = model;