Book Image

Mastering Graphics Programming with Vulkan

By : Marco Castorina, Gabriel Sassone
5 (1)
Book Image

Mastering Graphics Programming with Vulkan

5 (1)
By: Marco Castorina, Gabriel Sassone

Overview of this book

Vulkan is now an established and flexible multi-platform graphics API. It has been adopted in many industries, including game development, medical imaging, movie productions, and media playback. Learning Vulkan is a foundational step to understanding how a modern graphics API works, both on desktop and mobile. In Mastering Graphics Programming with Vulkan, you’ll begin by developing the foundations of a rendering framework. You’ll learn how to leverage advanced Vulkan features to write a modern rendering engine. The chapters will cover how to automate resource binding and dependencies. You’ll then take advantage of GPU-driven rendering to scale the size of your scenes and finally, you’ll get familiar with ray tracing techniques that will improve the visual quality of your rendered image. By the end of this book, you’ll have a thorough understanding of the inner workings of a modern rendering engine and the graphics techniques employed to achieve state-of-the-art results. The framework developed in this book will be the starting point for all your future experiments.
Table of Contents (21 chapters)
1
Part 1: Foundations of a Modern Rendering Engine
7
Part 2: GPU-Driven Rendering
13
Part 3: Advanced Rendering Techniques

What this book covers

Chapter 1, Introducing the Raptor Engine and Hydra, introduces you to the structure of our framework by providing an overview of the main components. We will then see how to compile the code for Windows and Linux.

Chapter 2, Improving Resources Management, simplifies managing textures for rendering by moving our renderer to use bindless textures. We will also automate the pipeline layout generation by parsing the generated SPIR-V and demonstrate how to implement pipeline caching.

Chapter 3, Unlocking Multi-Threading, details the concept of task-based parallelism that will help us make use of multiple cores. We will leverage this technique to load resources asynchronously and record multiple command buffers in parallel.

Chapter 4, Implementing a Frame Graph, helps us develop the frame graph, a data structure that holds our render passes and how they depend on each other. We will leverage this data structure to automate resource barrier placement and improve memory usage with resource aliasing.

Chapter 5, Unlocking Async Compute, illustrates how to leverage the async compute queue in Vulkan. We introduce timeline semaphores, which make it easier to manage queue synchronization. Finally, we will implement a simple cloth simulation, which runs on a separate queue.

Chapter 6, GPU-Driven Rendering, moves our renderer from meshes to meshlets, which are small groups of triangles that are used to implement GPU culling. We will introduce mesh shaders and explain how they can be leveraged to implement modern culling techniques.

Chapter 7, Rendering Many Lights with Clustered Deferred Rendering, describes our G-buffer implementation before moving to clustered light rendering. We will demonstrate how to leverage screen tiles and depth binning for an efficient implementation.

Chapter 8, Adding Shadows Using Mesh Shaders, provides a brief history of shadow techniques and then proceeds to describe our chosen approach. We leverage our meshlets and mesh shaders support to efficiently render cubemap shadowmaps. We will also demonstrate how to use sparse resources to reduce memory usage.

Chapter 9, Implementing Variable Rate Shading, gives us an overview of variable rate shading and explains why it’s useful. We will then describe how to use the Vulkan extension to add this technique to our renderer.

Chapter 10, Adding Volumetric Fog, implements a volumetric effect from first principles. We will then discuss spatial and temporal filtering to improve the quality of the final result.

Chapter 11, Temporal Anti-Aliasing, walks through a brief history of anti-aliasing techniques. We will then describe all the steps required to implement a robust temporal anti-aliasing solution.

Chapter 12, Getting Started with Ray Tracing, outlines the key concepts required to make use of the ray-tracing extension in Vulkan. We will then provide the implementation details for creating ray-tracing pipelines, shader-binding tables, and Acceleration Structures.

Chapter 13, Revisiting Shadows with Ray Tracing, offers up an alternative implementation of shadows that uses ray tracing. We will describe an algorithm that leverages dynamic ray count per light, paired with a spatial and temporal filter to produce stable results.

Chapter 14, Adding Dynamic Diffuse Global Illumination with Ray Tracing, involves adding global illumination to our scene. We will describe our use of ray tracing to generate probe data and provide a solution to minimize light leaking.

Chapter 15, Adding Reflections with Ray Tracing, briefly covers screen-space reflections and their shortcomings. We will then describe our implementation of ray-traced reflections. Finally, we will implement a denoiser to make the result usable for the final lighting computation.