Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void RenderGaussian(Texture2D current)
- {
- // pass the current image to sample from
- _blurEffect.SampleFrom = current;
- // pass blur size
- // TODO: Parameterize this
- _blurEffect.BlurSize = 0.2f;
- // blur horizontal then vertical in 2 explicit passes
- _blurEffect.ApplyHorizontalBlur();
- _quadRenderer.Render(Vector2.One * -1.0f, Vector2.One);
- // resolve the render target and pass it back in
- _device.SetRenderTarget(null);
- Texture2D next = _postRT;
- _blurEffect.SampleFrom = next;
- _device.SetRenderTarget(_postRT);
- _device.Clear(Color.Red);
- _blurEffect.ApplyVerticalBlur();
- _quadRenderer.Render(Vector2.One * -1.0f, Vector2.One);
- }
Add Comment
Please, Sign In to add comment