Guest User

Untitled

a guest
May 25th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. private void RenderGaussian(Texture2D current)
  2.         {
  3.             // pass the current image to sample from
  4.             _blurEffect.SampleFrom = current;
  5.  
  6.             // pass blur size
  7.             // TODO: Parameterize this
  8.             _blurEffect.BlurSize = 0.2f;
  9.  
  10.             // blur horizontal then vertical in 2 explicit passes
  11.             _blurEffect.ApplyHorizontalBlur();
  12.             _quadRenderer.Render(Vector2.One * -1.0f, Vector2.One);
  13.  
  14.             // resolve the render target and pass it back in
  15.             _device.SetRenderTarget(null);
  16.             Texture2D next = _postRT;
  17.            
  18.             _blurEffect.SampleFrom = next;
  19.             _device.SetRenderTarget(_postRT);
  20.             _device.Clear(Color.Red);
  21.  
  22.             _blurEffect.ApplyVerticalBlur();
  23.             _quadRenderer.Render(Vector2.One * -1.0f, Vector2.One);
  24.  
  25.         }
Add Comment
Please, Sign In to add comment