Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSL150/BlurV_ps20.glsl @ 12083

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

Reorganised shader programs

File size: 1.2 KB
Line 
1#version 150
2
3// Note, this won't work on ATI which is why it's not used
4// the issue is with the array initializers
5// no card supports GL_3DL_array_objects but it does work on nvidia, not on ATI
6//#extension GL_3DL_array_objects : enable
7
8//-------------------------------
9//BlurV_ps20.glsl
10// Vertical Gaussian-Blur pass
11//-------------------------------
12
13uniform sampler2D Blur0;
14out vec4 fragColour;
15in vec2 texCoord[5];
16
17vec2 pos[11]  = vec2[11](
18        vec2(0.0, -5.0),
19        vec2(0.0, -4.0),
20        vec2(0.0, -3.0),
21        vec2(0.0, -2.0),
22        vec2(0.0, -1.0),
23        vec2(0.0, 0.0),
24        vec2(0.0, 1.0),
25        vec2(0.0, 2.0),
26        vec2(0.0, 3.0),
27        vec2(0.0, 4.0),
28        vec2(0.0, 5.0)
29);
30
31//We use the Normal-gauss distribution formula
32//f(x) being the formula, we used f(0.5)-f(-0.5); f(1.5)-f(0.5)...
33float samples[11] = float[11] 
34(//stddev=2.0
350.01222447,
360.02783468,
370.06559061,
380.12097757,
390.17466632,
40
410.19741265,
42
430.17466632,
440.12097757,
450.06559061,
460.02783468,
470.01222447
48);
49
50void main()
51{
52    vec4 retVal;
53   
54    vec4 sum;
55    int i = 0;
56
57    sum = vec4( 0 );
58    for( ;i < 11; i++ )
59    {
60        sum += texture( Blur0, texCoord[0] + (pos[i] * 0.0100000) ) * samples[i];
61    }
62
63    fragColour = sum;
64}
Note: See TracBrowser for help on using the repository browser.