Post effects and shaders
You know those big budget games with dedicated graphics programmers on them? One of the techniques they use is something called post rendering or post effects. It's an effect that is applied after the scene has already been rendered. Using that data, we perform whatever visual effect we want on it. One way to create effects is using shaders, which we will delve into later.
The first thing to cover is how to perform a post effect, how it works, and then we will actually create an effect called bloom using shaders.
Fullscreen post effects
Well, the effect has to be applied to the whole screen, otherwise it is pretty useless. That is why we define a specific PostEffect
class in order to make this a bit easier.
class PostEffect { public: virtual ~PostEffect(); virtual void apply(const sf::RenderTexture& input,sf::RenderTarget& output) = 0; static bool isSupported(); protected: static void ...