File: fft_fragment_program_blur.glsl.frag.h

package info (click to toggle)
retroarch 1.7.3%2Bdfsg1-1.1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 49,188 kB
  • sloc: ansic: 600,492; cpp: 23,670; objc: 8,299; asm: 6,404; sh: 2,203; xml: 2,144; makefile: 1,867; python: 1,582; java: 941; perl: 393
file content (28 lines) | stat: -rw-r--r-- 742 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "shaders_common.h"

static const char *fft_fragment_program_blur = GLSL_300(
   precision mediump float;
   precision highp int;
   precision highp usampler2D;
   precision highp isampler2D;
   in vec2 vTex;
   out vec4 FragColor;
   uniform sampler2D sHeight;

   void main() {
      float k = 0.0;
      float t;
      vec4 res = vec4(0.0);
      \n#define kernel(x, y) t = exp(-0.35 * float((x) * (x) + (y) * (y))); k += t; res += t * textureLodOffset(sHeight, vTex, 0.0, ivec2(x, y))\n
       kernel(-1, -2);
       kernel(-1, -1);
       kernel(-1,  0);
       kernel( 0, -2);
       kernel( 0, -1);
       kernel( 0,  0);
       kernel( 1, -2);
       kernel( 1, -1);
       kernel( 1,  0);
       FragColor = res / k;
   }
);