source: trunk/tools/neercs/video/color.lolfx @ 1905

Last change on this file since 1905 was 1905, checked in by lolbot, 7 years ago

fixed 14 files out of 2200:

  • removed 0 CR characters
  • removed 12 trailing whitespaces
  • replaced 245 tabs with spaces
File size: 805 bytes
Line 
1-- GLSL.Vert --
2
3#version 120
4
5void main()
6    {
7    gl_Position=gl_Vertex;
8    gl_TexCoord[0]=gl_MultiTexCoord0;
9    }
10
11-- GLSL.Frag --
12
13#version 120
14
15uniform sampler2D texture;
16uniform vec2 screen_size;
17uniform vec3 filter;
18uniform vec3 color;
19uniform float flash;
20
21void main(void)
22    {
23    vec2 p=gl_FragCoord.xy/screen_size.xy;
24    vec3 c=texture2D(texture,p).xyz;
25
26    float a=(c.x+c.y+c.z)/3.0;
27    c=mix(c,vec3(a),color.z);                                // grayscale
28    c*=filter;                                                // filter
29    c*=color.x;                                                // brightness
30    c=0.5+(c-0.5)*color.y;                                    // contrast
31    c+=flash;                                                // flash
32
33    gl_FragColor=vec4(c,1.0);
34    }
Note: See TracBrowser for help on using the repository browser.