Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/trunk/programs/hdr_downscale3x3.glsl @ 12033

Last change on this file since 12033 was 7708, checked in by dafrick, 14 years ago

Merging cleanup branch. You will need to update your data repository as well as your local copy of the code.

  • Property svn:eol-style set to native
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.