dungeon_crawler

view 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
line source
1 uniform sampler2D mrt0, mrt1, mrt2, mrt3;
2 uniform vec2 tex_scale;
4 void main()
5 {
6 vec2 tc = gl_TexCoord[0].st;
8 vec4 texel;
9 if(tc.x < 0.25) {
10 texel = texture2D(mrt0, tc * vec2(4.0, 1.0) * tex_scale);
11 } else if(tc.x < 0.5) {
12 texel = texture2D(mrt1, (tc - vec2(0.25, 0.0)) * vec2(4.0, 1.0) * tex_scale);
13 } else if(tc.x < 0.75) {
14 texel = texture2D(mrt2, (tc - vec2(0.5, 0.0)) * vec2(4.0, 1.0) * tex_scale);
15 } else {
16 texel = texture2D(mrt3, (tc - vec2(0.75, 0.0)) * vec2(4.0, 1.0) * tex_scale);
17 }
19 gl_FragColor = texel;
20 }