dungeon_crawler
view prototype/sdr/deferred.p.glsl @ 34:85734f319626
passing shininess and specular in mrt
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 28 Aug 2012 03:34:56 +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 }