Simple color grading shader v1.0
It's written in GLSL, also it's my FIRST shader ever.
It's still not finished, needs a few tweaks and stuff but it works.
Yes, desaturation feature IS in plans.
The shader basically lets you add different atmosphere to the map, set colors for shadows, midtones and bright areas.
->>For those who don't know what color grading is please check out this URL: http://udn.epicgames.com/Three/ColorGrading.html
Also sorry, It's still not saving settings but I'll add feature to add presets later.
USAGE:
Just type in your autoexec.cfg "exec cgrade.cfg"
Then you can bind/use/whatever the cgrade gui or just open it with /showgui cgrade
You may use the shader whereever and however you want but you should credit me then.
Have fun.
fsvs = [ void main(void) { gl_Position = gl_Vertex; // woohoo, no mvp :) gl_TexCoord[0].xy = gl_MultiTexCoord0.xy; ] fsps = [ #extension GL_ARB_texture_rectangle : enable uniform sampler2DRect tex0; void main(void) { vec4 sample = texture2DRect(tex0, gl_TexCoord[0].xy); ] //////////////////////////////////////////////// // // color grading shader definitions: // //////////////////////////////////////////////// lazyshader 4 "colorgrade_shadows" [ @fsvs } ] [ uniform vec4 params; @fsps float factor = max(sample.x, max(sample.y, sample.z)); vec4 shadows = params; if(factor 0.01) { factor = (factor + 0.09)*10; shadows.w = shadows.x; //.w is value backup shadows.x = ((1 - shadows.w) / 2) * factor; shadows.x += shadows.w; //Adding backup shadows.w = shadows.y; //.w is value backup shadows.y = ((1 - shadows.w) / 2) * factor; shadows.y += shadows.w; //Adding backup shadows.w = shadows.z; //.w is value backup shadows.z = ((1 - shadows.w) / 2) * factor; shadows.z += shadows.w; //Adding backup } gl_FragColor = vec4(sample.x * shadows.x, sample.y * shadows.y, sample.z * shadows.z, sample.w); } else gl_FragColor = vec4(sample); } ] lazyshader 4 "colorgrade_midtones" [ @fsvs } ] [ uniform vec4 params; @fsps float factor = (sample.x + sample.y + sample.z)/3; vec4 midtones = params; if(factor >= 0.1 && factor 0.3) { factor = (factor - 0.31)*10; midtones.w = midtones.x; //.w is value backup midtones.x = ((1 - midtones.w) / 2) * factor; midtones.x += midtones.w; //Adding backup midtones.w = midtones.y; //.w is value backup midtones.y = ((1 - midtones.w) / 2) * factor; midtones.y += midtones.w; //Adding backup midtones.w = midtones.z; //.w is value backup midtones.z = ((1 - midtones.w) / 2) * factor; midtones.z += midtones.w; //Adding backup } else if(factor 0.5) //Hightlights { if(factor