Implementing fullscreen quad rendering
All postprocessing recipes in this chapter require you to render a fullscreen quad using a specific fragment shader for each effect. While the fragment shaders should be very specific to each effect, the vertex shader can be the same. Furthermore, while we can trivially render a quad using a classic vertex buffer object approach, this might be cumbersome to manage in situations where we should mix and match tens or hundreds of shader combinations in different parts of the rendering pipeline. In this recipe, we show a very simple way to generate a quad right in the vertex shader in a similar way to how we generated a cube in Chapter 3, Getting Started with OpenGL and Vulkan.
Getting ready
Check out the Implementing programmable vertex pulling in OpenGL recipe from Chapter 3, Getting Started with OpenGL and Vulkan.
How to do it…
Let's go through the code of our fullscreen quad vertex shader. The shader can be found in the...