Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/OLD/hdr_downscale3x3.glsl @ 12373

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

Reorganised shader programs

File size: 846 bytes
Line 
1uniform sampler2D inRTT;
2uniform vec2 texelSize;
3
4varying vec2 uv;
5
6void main(void)
7{
8    vec4 accum = vec4(0.0, 0.0, 0.0, 0.0);
9
10    // Get colour from source
11    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, -1.0));
12    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, -1.0));
13    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, -1.0));
14    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0,  0.0));
15    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0,  0.0));
16    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0,  0.0));
17    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0,  1.0));
18    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0,  1.0));
19    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0,  1.0));
20   
21        // take average of 9 samples
22        accum *= 0.1111111111111111;
23
24        gl_FragColor = accum;
25
26}
Note: See TracBrowser for help on using the repository browser.