Post-processing is the process of adding effects by re-rendering the image of the scene with a shader that alters the final image. You can think of this as the process of taking a screenshot of your scene (ideally at 60+ frames per second), opening it up in your favorite image editor, and applying various filters. The difference is, of course, that we can do so in real time!
Some examples of simple post-processing effects include the following:
- Grayscale
- Sepia tone
- Inverted colors
- Film grain
- Blur
- Wavy/dizzy effect
The basic technique for creating these effects is relatively simple: create a framebuffer with the same dimensions as the canvas and have the entire scene rendered to it at the beginning of the draw cycle. Then, a quad is rendered to the default framebuffer using the texture that makes up the framebuffer's color attachment. The shader used during...