Last change
on this file since 12092 was
12091,
checked in by wiesep, 6 years ago
|
Updated programs and adjusted Material to work with GLSL>150
|
File size:
908 bytes
|
Line | |
---|
1 | #version 100 |
---|
2 | precision mediump int; |
---|
3 | precision mediump float; |
---|
4 | |
---|
5 | uniform sampler2D inRTT; |
---|
6 | uniform vec2 texelSize; |
---|
7 | |
---|
8 | varying vec2 uv; |
---|
9 | |
---|
10 | void main(void) |
---|
11 | { |
---|
12 | vec4 accum = vec4(0.0, 0.0, 0.0, 0.0); |
---|
13 | |
---|
14 | // Get colour from source |
---|
15 | accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, -1.0)); |
---|
16 | accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, -1.0)); |
---|
17 | accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, -1.0)); |
---|
18 | accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, 0.0)); |
---|
19 | accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, 0.0)); |
---|
20 | accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, 0.0)); |
---|
21 | accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, 1.0)); |
---|
22 | accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, 1.0)); |
---|
23 | accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, 1.0)); |
---|
24 | |
---|
25 | // take average of 9 samples |
---|
26 | accum *= 0.1111111111111111; |
---|
27 | |
---|
28 | gl_FragColor = accum; |
---|
29 | |
---|
30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.