Make check_error() output the file as well as the line, now that we have several.
[movit] / vs.glsl
1 #version 120
2 varying vec2 tc;
3 //varying vec3 lift, inv_gamma, gain;
4 //uniform vec3 gamma;
5 //varying vec3 inv_gamma;
6 //varying mat3 colorMat;
7 //uniform vec3 lift, gain;
8
9 vec3 to_linear(vec3 x) {
10         vec3 a = x * vec3(1.0/12.92); 
11         vec3 b = pow((x + vec3(0.055)) * vec3(1.0/1.055), vec3(2.4));
12         vec3 f = vec3(greaterThan(x, vec3(0.04045)));
13         return mix(a, b, f); 
14
15
16 void main()
17 {
18         tc = gl_MultiTexCoord0.st;
19
20         //lift = to_linear(vec3(rgba.r, 0.0, 0.0));
21         //lift = vec3(rgba.r, 0.0, 0.0);
22 //      lift = vec3(0.0, 0.0, 0.0);
23 //      inv_gamma = vec3(1.0) / vec3(1.0, 1.0, 1.0 + 2.0 * rgba.r);
24 //      gain = vec3(1.0, 1.0, 1.0);
25         //gain = vec3(1.0 + rgba.r * 3.0, 1.0, 1.0);
26         //gain = vec3(1.0, 1.0, 1.0 + rgba.r * 3.0);
27         //inv_gamma = vec3(1.0) / gamma;
28
29 #if 0
30         vec4 rgba = gl_MultiTexCoord1;
31         rgba.b = rgba.r;
32         rgba.r = 1.0f;
33         rgba.g = 1.0f;
34         rgba.a = 0.0f;
35
36         mat3 rgb_to_xyz = mat3(
37                 0.4124, 0.3576, 0.1805,
38                 0.2126, 0.7152, 0.0722,
39                 0.0193, 0.1192, 0.9505
40         );
41         mat3 xyz_to_lms = mat3(
42                  0.4002, 0.7076, -0.0808,
43                 -0.2263, 1.1653,  0.0457,
44                     0.0,    0.0,  0.9182
45         );
46         mat3 lms_corr_matrix = mat3(
47                 rgba.r, 0, 0,
48                 0, rgba.g, 0,
49                 0, 0, rgba.b
50         );
51         mat3 lms_to_xyz = mat3(
52                 1.86007, -1.12948,  0.21990,
53                 0.36122,  0.63880, -0.00001,
54                 0.00000,  0.00000,  1.08909
55         );
56         mat3 xyz_to_rgb = mat3(
57                  3.240625, -1.537208, -0.498629,
58                 -0.968931,  1.875756,  0.041518,
59                  0.055710, -0.204021,  1.056996
60         );
61         colorMat = xyz_to_rgb * lms_to_xyz * lms_corr_matrix * xyz_to_lms * rgb_to_xyz;
62 #endif
63
64         gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
65 }
66