Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/data_extern/programs/GLSL120/BlurH_ps20.glsl @ 12202

Last change on this file since 12202 was 12115, checked in by wiesep, 6 years ago

Changed folder structure, deletet some unused files and cleaned up code

File size: 894 bytes
Line 
1//-------------------------------
2//BlurH_ps20.glsl
3// Horizontal Gaussian-Blur pass
4//-------------------------------
5#version 120
6
7uniform sampler2D Blur0;
8varying vec2 texCoord;
9
10vec2 pos[11] = vec2[11]
11(
12        vec2( -5, 0),
13        vec2( -4, 0),
14        vec2( -3, 0),
15        vec2( -2, 0),
16        vec2( -1, 0),
17        vec2( 0, 0),
18        vec2( 1, 0),
19        vec2( 2, 0),
20        vec2( 3, 0),
21        vec2( 4, 0),
22        vec2( 5, 0)
23);
24
25//We use the Normal-gauss distribution formula
26//f(x) being the formula, we used f(0.5)-f(-0.5); f(1.5)-f(0.5)...
27float samples[11] = float[11]
28(//stddev=2.0
290.01222447,
300.02783468,
310.06559061,
320.12097757,
330.17466632,
34
350.19741265,
36
370.17466632,
380.12097757,
390.06559061,
400.02783468,
410.01222447
42);
43
44void main()
45{
46    vec4 retVal;
47    vec4 sum;
48    int i = 0;
49
50    sum = vec4( 0 );
51    for( i=0;i < 11; i++ )
52    {
53        sum += texture2D( Blur0, texCoord + (pos[i] * 0.0100000) ) * samples[i];
54    }
55
56    gl_FragColor = sum;
57}
Note: See TracBrowser for help on using the repository browser.