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

Defining and creating a ray tracing pipeline

Now that we have defined our Acceleration Structures, we can turn our attention to ray tracing pipelines. As we mentioned previously, ray tracing shaders work differently compared to traditional graphics and compute shaders. Ray tracing shaders are setup to call other shaders according to the shader binding table setup.

If you are familiar with C++, you can think of this setup as a simple form of polymorphism: the interface of a ray tracing pipeline is always the same, but we can dynamically override which shaders (methods) get called at runtime. We don’t have to define all the entry points though.

In this example, for instance, we are going to define only a ray generation, the closest hit, and the miss shader. We are ignoring any-hit and intersection shaders for now.

As the name implies, the shader binding table can be represented in table form. This is the binding table we are going to build in our example:

...