annotate sdr/colorcode.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 |
|
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 vec3 col, coeff = vec3(0.15, 0.15, 0.7);
|
nuclear@0
|
14 col.r = left.r;
|
nuclear@0
|
15 col.g = left.g;
|
nuclear@0
|
16 col.b = dot(right, coeff);
|
nuclear@0
|
17
|
nuclear@0
|
18 gl_FragColor = vec4(col, 1.0);
|
nuclear@0
|
19 }
|