Line | |
---|
1 | -- GLSL.Vert -- |
---|
2 | |
---|
3 | #version 120 |
---|
4 | |
---|
5 | void main() |
---|
6 | { |
---|
7 | gl_Position=gl_Vertex; |
---|
8 | gl_TexCoord[0]=gl_MultiTexCoord0; |
---|
9 | } |
---|
10 | |
---|
11 | -- GLSL.Frag -- |
---|
12 | |
---|
13 | #version 120 |
---|
14 | |
---|
15 | uniform sampler2D texture; |
---|
16 | uniform vec2 screen_size; |
---|
17 | uniform vec3 filter; |
---|
18 | uniform vec3 color; |
---|
19 | uniform float flash; |
---|
20 | |
---|
21 | void 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.