Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/GLSL120/BlurV_ps20.glsl @ 12323

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

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

File size: 1.1 KB
Line 
1// Note, this won't work on ATI which is why it's not used
2// the issue is with the array initializers
3// no card supports GL_3DL_array_objects but it does work on nvidia, not on ATI
4//#extension GL_3DL_array_objects : enable
5#version 120
6
7//-------------------------------
8//BlurV_ps20.glsl
9// Vertical Gaussian-Blur pass
10//-------------------------------
11
12uniform sampler2D Blur0;
13varying vec2 texCoord;
14
15vec2 pos[11]  = vec2[11](
16        vec2(0.0, -5.0),
17        vec2(0.0, -4.0),
18        vec2(0.0, -3.0),
19        vec2(0.0, -2.0),
20        vec2(0.0, -1.0),
21        vec2(0.0, 0.0),
22        vec2(0.0, 1.0),
23        vec2(0.0, 2.0),
24        vec2(0.0, 3.0),
25        vec2(0.0, 4.0),
26        vec2(0.0, 5.0)
27);
28
29//We use the Normal-gauss distribution formula
30//f(x) being the formula, we used f(0.5)-f(-0.5); f(1.5)-f(0.5)...
31float samples[11] = float[11] 
32(//stddev=2.0
330.01222447,
340.02783468,
350.06559061,
360.12097757,
370.17466632,
38
390.19741265,
40
410.17466632,
420.12097757,
430.06559061,
440.02783468,
450.01222447
46);
47
48void main()
49{
50    vec4 retVal;
51    vec4 sum;
52    int i = 0;
53
54    sum = vec4( 0 );
55    for( ;i < 11; i++ )
56    {
57        sum += texture2D( Blur0, texCoord + (pos[i] * 0.0100000) ) * samples[i];
58    }
59
60    gl_FragColor = sum;
61}
Note: See TracBrowser for help on using the repository browser.