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

Last change on this file since 1928 was 1928, checked in by sam, 8 years ago

lolfx: use square brackets to indicate shader sections.

File size: 776 bytes
Line 
1[vert.glsl]
2
3#version 120
4
5void main()
6{
7    gl_Position = gl_Vertex;
8    gl_TexCoord[0] = gl_MultiTexCoord0;
9}
10
11[frag.glsl]
12
13#version 120
14
15uniform sampler2D texture;
16uniform vec2 screen_size;
17uniform vec3 filter;
18uniform vec4 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.w);                // grayscale
28    c *= filter;                               // filter
29    c += color.z*0.1;                          // level
30    c *= color.x;                              // brightness
31    c = 0.5+(c-0.5)*color.y;                   // contrast
32    c += flash;                                // flash
33
34    gl_FragColor = vec4(c,1.0);
35}
Note: See TracBrowser for help on using the repository browser.