nuclear@0: uniform sampler2D tex; nuclear@0: uniform float left_offs, right_offs; nuclear@0: nuclear@0: void main() nuclear@0: { nuclear@0: vec2 tc_half = gl_TexCoord[0].st * vec2(0.5, 1.0); nuclear@0: vec2 tc_left = tc_half + vec2(left_offs, 0.0); nuclear@0: vec2 tc_right = tc_half + vec2(right_offs, 0.0); nuclear@0: nuclear@0: vec3 left = texture2D(tex, tc_left).rgb; nuclear@0: vec3 right = texture2D(tex, tc_right).rgb; nuclear@0: nuclear@0: nuclear@0: nuclear@0: vec3 col; nuclear@0: col.r = (left.r + left.g + left.b) / 3.0; nuclear@0: col.g = 0.0; nuclear@0: col.b = (right.r + right.g + right.b) / 3.0; nuclear@0: nuclear@0: gl_FragColor = vec4(col, 1.0); nuclear@0: }