- uniform sampler2D Texture0;
- uniform float width;
- uniform float height;
- uniform float facwidth;
- uniform float facheight;
- const int samples = 8;
- const float sum = 3.0359;
- void main(void)
- {
- //Gausssche Normalverteilung:
- float sample[9];
- sample[0] = 1.0000;
- sample[1] = 0.9394;
- sample[2] = 0.7788;
- sample[3] = 0.5697;
- sample[4] = 0.3678;
- sample[4] = 0.2096;
- sample[5] = 0.1053;
- sample[7] = 0.0467;
- sample[8] = 0.0183;
- vec2 tc = vec2(gl_TexCoord[0]);
- float xp = facwidth/width;
- vec4 col = texture2D(Texture0, tc);
- vec2 tco = tc;
- col = texture2D(Texture0, vec2(tc.s-(1.0*xp), tc.t)) * sample[1];
- col = texture2D(Texture0, vec2(tc.s+(1.0*xp), tc.t)) * sample[1];
- /*col = texture2D(Texture0, vec2(tc.s-(2.0*xp), tc.t)) * sample[2];
- col += texture2D(Texture0, vec2(tc.s+(2.0*xp), tc.t)) * sample[2];
- col += texture2D(Texture0, vec2(tc.s-(3.0*xp), tc.t)) * sample[3];
- col += texture2D(Texture0, vec2(tc.s+(3.0*xp), tc.t)) * sample[3];
- col += texture2D(Texture0, vec2(tc.s-(4.0*xp), tc.t)) * sample[4];
- col += texture2D(Texture0, vec2(tc.s+(4.0*xp), tc.t)) * sample[4];
- col += texture2D(Texture0, vec2(tc.s-(5.0*xp), tc.t)) * sample[5];
- col += texture2D(Texture0, vec2(tc.s+(5.0*xp), tc.t)) * sample[5];
- col += texture2D(Texture0, vec2(tc.s-(6.0*xp), tc.t)) * sample[6];
- col += texture2D(Texture0, vec2(tc.s+(6.0*xp), tc.t)) * sample[6];
- col += texture2D(Texture0, vec2(tc.s-(7.0*xp), tc.t)) * sample[7];
- col += texture2D(Texture0, vec2(tc.s+(7.0*xp), tc.t)) * sample[7];
- col += texture2D(Texture0, vec2(tc.s-(8.0*xp), tc.t)) * sample[8];
- col += texture2D(Texture0, vec2(tc.s+(8.0*xp), tc.t)) * sample[8]; */
- gl_FragColor = col/(1.0+2.0*sum);
- }