Last change
on this file since 1913 was
1913,
checked in by rez, 8 years ago
|
NEERCS: tweaked color filtering (still lame result)
|
File size:
871 bytes
|
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 vec4 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.w); // grayscale |
---|
28 | c*=filter; // filter |
---|
29 | c+=color.z; // 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.