|While not the game I am working on, still a neat example of|
all the cool things shaders can create.
Instead of drawing a quad on top of everything to fake this fading effect, why don't I just actually fade everything? I could simply add a uniform transparency value to the shader file, and then set that for every object once and it would fade each object equally! The results were astounding, because I could also change the color by just changing the screen's clear color glClearColor. Suddenly I could fade out to any color, without any extra resources being needed outside of that one uniform value!
While this method is pretty good with reducing memory usage, and also is a lot easier to implement, it does have its downsides. Because you are multiplying the alpha values for each object, you are technically using more clock cycles with the multiplication of each fragment. This means you'll want to be cautious if you want everything processed in a timely manor. Luckily I did not run into that issue in this case, but that's a big thing to keep in mind.