radial_blur.swsl 532 B

1234567891011121314
  1. uniform sampler2D SCREEN_TEXTURE;
  2. uniform highp float Strength;
  3. const highp int SampleCount = 10; // a higher number makes the shader look better, but has a big performance impact
  4. // a simple radial blur
  5. void fragment() {
  6. highp vec2 uv = FRAGCOORD.xy * SCREEN_PIXEL_SIZE.xy;
  7. highp vec2 direction = vec2(0.5, 0.5) - uv;
  8. for (int i=1; i <= SampleCount; i++)
  9. {
  10. COLOR += zTextureSpec(SCREEN_TEXTURE, uv + float(i) * Strength / float(SampleCount) * direction);
  11. }
  12. COLOR = COLOR / float(SampleCount);
  13. }