stereoplay
view sdr/redblue.glsl @ 6:8fc045d33d62
updated the code to work with more recent ffmpeg versions
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 26 Sep 2020 14:26:39 +0300 |
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;
15 vec3 col;
16 col.r = (left.r + left.g + left.b) / 3.0;
17 col.g = 0.0;
18 col.b = (right.r + right.g + right.b) / 3.0;
20 gl_FragColor = vec4(col, 1.0);
21 }