source:
data/trunk/programs/hdr_downscale3x3.glsl
@
12323
Last change on this file since 12323 was 7708, checked in by dafrick, 14 years ago | |
---|---|
|
|
File size: 846 bytes |
Line | |
---|---|
1 | uniform sampler2D inRTT; |
2 | uniform vec2 texelSize; |
3 | |
4 | varying vec2 uv; |
5 | |
6 | void 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.