How it works...

Creating a postprocessing effect that is rendered inside the same render pass as the scene is performed in two steps.

In the first step, we need to prepare resources for the base scene: its geometry, textures, descriptor sets, and pipeline objects, among others. In the second step, we do the same for the full-screen quad, as described in the Rendering a fullscreen quad for postprocessing recipe.

The two most important resources prepared solely for the post-processing phase are an image and a graphics pipeline. The image will serve as a color attachment when we are rendering the scene in a normal way. We just render the scene into the image instead of rendering it into a swapchain image. The image must serve both as a color ...

Get Vulkan Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.