stereoplay

view sdr/colorcode.glsl @ 0:265a24704ff2

stereoplay
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 06 Mar 2011 20:31:18 +0200
parents
children
line source
1 uniform sampler2D tex;
2 uniform float left_offs, right_offs;
4 void main()
5 {
6 vec2 tc_half = gl_TexCoord[0].st * vec2(0.5, 1.0);
7 vec2 tc_left = tc_half + vec2(left_offs, 0.0);
8 vec2 tc_right = tc_half + vec2(right_offs, 0.0);
10 vec3 left = texture2D(tex, tc_left).rgb;
11 vec3 right = texture2D(tex, tc_right).rgb;
13 vec3 col, coeff = vec3(0.15, 0.15, 0.7);
14 col.r = left.r;
15 col.g = left.g;
16 col.b = dot(right, coeff);
18 gl_FragColor = vec4(col, 1.0);
19 }