stereoplay
annotate sdr/redblue.glsl @ 4:acf3d25f23cb
added license headings
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 03 Nov 2011 21:57:12 +0200 |
parents | |
children |
rev | line source |
---|---|
nuclear@0 | 1 uniform sampler2D tex; |
nuclear@0 | 2 uniform float left_offs, right_offs; |
nuclear@0 | 3 |
nuclear@0 | 4 void main() |
nuclear@0 | 5 { |
nuclear@0 | 6 vec2 tc_half = gl_TexCoord[0].st * vec2(0.5, 1.0); |
nuclear@0 | 7 vec2 tc_left = tc_half + vec2(left_offs, 0.0); |
nuclear@0 | 8 vec2 tc_right = tc_half + vec2(right_offs, 0.0); |
nuclear@0 | 9 |
nuclear@0 | 10 vec3 left = texture2D(tex, tc_left).rgb; |
nuclear@0 | 11 vec3 right = texture2D(tex, tc_right).rgb; |
nuclear@0 | 12 |
nuclear@0 | 13 |
nuclear@0 | 14 |
nuclear@0 | 15 vec3 col; |
nuclear@0 | 16 col.r = (left.r + left.g + left.b) / 3.0; |
nuclear@0 | 17 col.g = 0.0; |
nuclear@0 | 18 col.b = (right.r + right.g + right.b) / 3.0; |
nuclear@0 | 19 |
nuclear@0 | 20 gl_FragColor = vec4(col, 1.0); |
nuclear@0 | 21 } |