Implementing SSAO in Vulkan
Earlier in this chapter, we learned how to implement SSAO in OpenGL and went through every detail of our code. This recipe shows how to implement this technique using the Vulkan API.
We will skip the GLSL shaders here because they are almost identical to those for OpenGL, and rather focus on the C++ parts of the code that deal with Vulkan.
Getting ready...
Make sure you read the Implementing SSAO in OpenGL recipe to understand the data flow of our SSAO implementation and the previous recipe, Writing postprocessing effects in Vulkan, to have a good grasp of the basic classes we use in our Vulkan wrapper.
The source code for this demo can be found in Chapter08/VK02_SSAO
.
How to do it...
The SSAOProcessor
class wraps multiple QuadProcessor
instances into a single streamlined reusable pipeline for SSAO rendering:
- A set of GLSL shaders for SSAO rendering is passed as arguments to the
QuadProcessor
instances:struct SSAOProcessor: public...