I found out that the post-processing effects are stored in the file "data/config/glsl.cfg", so I decided to mess with them. I found that after a while I could sort of decypher the simpler shaders such as gbr and bw, so I made a shader that does very primitive color enhancement, and I went through a bunch of maps taking pictures. I was able to make a color filter that makes most maks look a lot like Battlefield 3 (or at least like Metro for darker maps), and I also made a custom filter that you can easily change the parameters of.
Here's the code: (copy into data/config/glsl.cfg; if new shaders don't work it doesn't effect anything but I'd still back it up on principle)
- {l Code}: {l Select All Code}
//Messing around
lazyshader 4 "battlefield" [ @fsvs } ] [ @fsps gl_FragColor = vec4((sample.x - 0.05) * 1.6, (sample.y - 0.02) * 1.3, sample.z * 1.1, sample.w); } ]
//for primitive color curves; 'vec4 params' is a vector with 3 parameters, each standing for how much the shadows are darkened for each color, plus one for how much colors are multipled to conpensate for darkened shadows (i.e. /setpostfx colorfilter 0.05 0 0 20 will darken red shadows and make bright reds even brighter, 0 0.5 0 20 will do the same for green, etc.)
lazyshader 4 "colorfilter" [ @fsvs } ] [
uniform vec4 params;
@fsps gl_FragColor = vec4((sample.x - params.x) * (1 + params.x * params.w), (sample.y - params.y) * (1 + params.y * params.w), (sample.z - params.z) * (1 + params.z * params.w), sample.w); } ]
How to use:
For the battlefield shader, simply type "/setpostfx battlefield".
(It works with other postfx shaders too, so you can type /bloom 0.3 and /addpostfx battlefield or /setpostfx battlefield and /addpostfx rotoscope, etc.)
The custom color filter has 4 parameters.
The first 3 darken the shadows of each of the primary colors (Red, Green, Blue), and typically they work best if one of the colors is left at 0 and the others are set from 0.02 to 0.05.
The 4th parameter controls how much brightness is multiplied to compensate; for example, /setpostfx colorfilter 0.05 0 0 20 will darken red shadows and make bright reds even brighter, 0 0.5 0 20 will do the same for green, etc. The 4th parameter works best in the 10 to 25 range.
Here are some screenshots I took:
In the long run, it would be awesome if there was some sort of auto-color-enhancer (and/or auto-bloom) that could tell if what you were seeing was dark or bright and adjust bloom and/or color accordingly. I'm guessing making something like that would be a lot harder than what I've done, but maybe someone experienced might want to try?