dungeon_crawler

view prototype/sdr/deferred.p.glsl @ 19:8a0ae6b4aa9b

trying to make MRT work
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 21 Aug 2012 04:29:49 +0300
parents 5c41e6fcb300
children 48cfd351a9be
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;
7 //vec4 texel0 = texture2D(mrt0, gl_TexCoord[0].st * s);
9 vec4 texel;
10 if(tc.x < 0.25) {
11 texel = texture2D(mrt0, tc * vec2(4.0, 1.0) * tex_scale);
12 } else if(tc.x < 0.5) {
13 texel = texture2D(mrt0, (tc - vec2(0.25, 0.0)) * vec2(4.0, 1.0) * tex_scale);
14 } else if(tc.x < 0.75) {
15 texel = texture2D(mrt0, (tc - vec2(0.5, 0.0)) * vec2(4.0, 1.0) * tex_scale);
16 } else {
17 texel = texture2D(mrt0, (tc - vec2(0.75, 0.0)) * vec2(4.0, 1.0) * tex_scale);
18 }
20 gl_FragColor = texel;
21 }