uniform sampler2D LeftUnit, RightUnit; uniform float OffsetS, OffsetT; uniform float Red, Green, Blue; void main() { vec2 st = gl_TexCoord[0].st; vec4 left = texture2D( LeftUnit, st ); vec4 right = texture2D( RightUnit, st+vec2(OffsetS,OffsetT) ); vec3 color = vec3( left.r, right.gb ); color *= vec3( Red, Green, Blue ); color = clamp( color, 0., 1. ); gl_FragColor = vec4( color, 1. ); }