Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Reorganised shader programs

File size: 956 bytes
Line 
1#version 150
2
3//-------------------------------
4//BlurH_ps20.glsl
5// Horizontal Gaussian-Blur pass
6//-------------------------------
7
8uniform sampler2D Blur0;
9out vec4 fragColour;
10in vec2 texCoord[5];
11
12vec2 pos[11] = vec2[11]
13(
14        vec2( -5, 0),
15        vec2( -4, 0),
16        vec2( -3, 0),
17        vec2( -2, 0),
18        vec2( -1, 0),
19        vec2( 0, 0),
20        vec2( 1, 0),
21        vec2( 2, 0),
22        vec2( 3, 0),
23        vec2( 4, 0),
24        vec2( 5, 0)
25);
26
27//We use the Normal-gauss distribution formula
28//f(x) being the formula, we used f(0.5)-f(-0.5); f(1.5)-f(0.5)...
29float samples[11] = float[11]
30(//stddev=2.0
310.01222447,
320.02783468,
330.06559061,
340.12097757,
350.17466632,
36
370.19741265,
38
390.17466632,
400.12097757,
410.06559061,
420.02783468,
430.01222447
44);
45
46void main()
47{
48    vec4 retVal;
49   
50    vec4 sum = vec4( 0 );
51
52    for( int i=0;i < 11; i++ )
53    {
54        sum += texture( Blur0, texCoord[0] + (pos[i] * 0.0100000) ) * samples[i];
55    }
56
57    fragColour = sum;
58}
Note: See TracBrowser for help on using the repository browser.