Hello there,
Some time ago I was playing with FS trying to get it all in grayscale (since some parts are still rendered using fixed-pipeline it wasn't a total success and I got "almost-a-Sin-City-style"
). What really pissed me of was amount of different shaders I had to modify. So I decided to fix this problem and introduce subtractive shader.
In this approach there is one huge shader with many #ifdefs. 3d engine can choose needed functions during shader compilation (it works in exactly the same way as C preprocessor does). Advantages: we have only one shader (one vertex shader and one fragment shader to be exact), code reusability is significantly increased, and everyting takes less space. Disadvantages: shader code is much harder too understand unless you are using editor that knows what #ifdef means
(notepad won't be a good idea). Additionally, there should not be any performance loss.
I kept backwards compatibility, so if FS can't find main-v and/or main-f files then its uses old-style shaders.
Full pack (release build, shaders, modified CPP file)
Any feedback will be appreciated.
PS I am rather unaware of SCP development process, hence I don't know it is the most convenient way to send patches made by new developers, but I hope it won't be a problem.