Guest User

Untitled

a guest
Nov 23rd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. // Pixel shader applies a one dimensional gaussian blur filter.
  2. // This is used twice by the bloom postprocess, first to
  3. // blur horizontally, and then again to blur vertically.
  4.  
  5. sampler TextureSampler : register(s0);
  6.  
  7. #define SAMPLE_COUNT 15
  8.  
  9. float2 SampleOffsets[SAMPLE_COUNT];
  10. float SampleWeights[SAMPLE_COUNT];
  11.  
  12.  
  13. float4 PixelShader(float2 texCoord : TEXCOORD0) : COLOR0
  14. {
  15. float4 c = 0;
  16.  
  17. // Combine a number of weighted image filter taps.
  18. for (int i = 0; i < SAMPLE_COUNT; i++)
  19. {
  20. c += tex2D(TextureSampler, texCoord + SampleOffsets[i]) * SampleWeights[i];
  21. }
  22.  
  23. return c;
  24. }
  25.  
  26.  
  27. technique GaussianBlur
  28. {
  29. pass Pass1
  30. {
  31. PixelShader = compile ps_2_0 PixelShader();
  32. }
  33. }
Add Comment
Please, Sign In to add comment