post_processing - JayDee-github/LearnOpenGL GitHub Wiki
Framebuffers and Post-processing
This implementation applies post-processing techniques.
The scene is first rendered to a framebuffer as a screen-sized texture. The texture is edited with a variety of post-processing algorithms then rendered on a screen-sized quad.
The following post-processing effects are implemented:
-
No filter: the original scene is draw without post-processing effects.

-
Inversion filter: RGB colors in the scene are inverted.

-
Grayscale filter: RGB colors are converted to a black and white spectrum.

-
Sharpen filter: edges are more defined.

-
Blur filter: edges are less defined.

-
Edge Detection filter: implemented like the sharpen filter but more contrast is added between edges.

-
Emboss filter: an effect that makes details on a flat surface seem raised.

-
Top-Sobel filter: an edge detection filter that emphasizes horizontal edges more than vertical edges.

The code follows examples outlined in:
Changes over example code
- The ability to toggle between filters.
- Emboss and Top-Sobel filters.
Running the implementation
-
Navigate the Solution Explorer to path:
Solution -> 04.advanced_opengl -> 05.framebuffers_and_post_processing -
Left-click the project name and select Set as Startup Project from the pop-up window.
-
Press F5 to run the project.
Interfacing with the implementation
Exiting
Press the ESC key to exit the implementation.
Movement
The movement key-bindings follow an FPS-style scheme:
- W move forward
- S move back
- A move left
- D move right
- Spacebar move up
- Left-Shift move down
- Mouse-movement look around the world.
Rendering manipulations
The numeric keys 1-8 are used to switch post-processing modes:
- 1 No filter
- 2 Inversion
- 3 Grayscale
- 4 Sharpen
- 5 Blur
- 6 Edge detection
- 7 Emboss
- 8 Top-Sobel