annotate prototype/sdr/deferred.p.glsl @ 31:ddb68dc4ba07
OBJ hack
author |
John Tsiombikas <nuclear@member.fsf.org> |
date |
Mon, 27 Aug 2012 04:14:04 +0300 |
parents |
8a0ae6b4aa9b |
children |
d0e93b4d9ec9 |
rev |
line source |
nuclear@19
|
1 uniform sampler2D mrt0, mrt1, mrt2, mrt3;
|
nuclear@18
|
2 uniform vec2 tex_scale;
|
nuclear@18
|
3
|
nuclear@17
|
4 void main()
|
nuclear@17
|
5 {
|
nuclear@19
|
6 vec2 tc = gl_TexCoord[0].st;
|
nuclear@19
|
7
|
nuclear@19
|
8 vec4 texel;
|
nuclear@19
|
9 if(tc.x < 0.25) {
|
nuclear@19
|
10 texel = texture2D(mrt0, tc * vec2(4.0, 1.0) * tex_scale);
|
nuclear@19
|
11 } else if(tc.x < 0.5) {
|
nuclear@20
|
12 texel = texture2D(mrt1, (tc - vec2(0.25, 0.0)) * vec2(4.0, 1.0) * tex_scale);
|
nuclear@19
|
13 } else if(tc.x < 0.75) {
|
nuclear@20
|
14 texel = texture2D(mrt2, (tc - vec2(0.5, 0.0)) * vec2(4.0, 1.0) * tex_scale);
|
nuclear@19
|
15 } else {
|
nuclear@20
|
16 texel = texture2D(mrt3, (tc - vec2(0.75, 0.0)) * vec2(4.0, 1.0) * tex_scale);
|
nuclear@19
|
17 }
|
nuclear@19
|
18
|
nuclear@19
|
19 gl_FragColor = texel;
|
nuclear@17
|
20 }
|