RustyVulkan GuideContents

A guided tour of a Rust + Vulkan renderer

RustyVulkan

A small real-time renderer: a meadow of millions of grass blades, cascaded sun shadows, a procedural valley, a panoramic sky and an ImGui control panel, written in Rust directly against the Vulkan API. This guide uses its code to explain how modern, explicit GPU programming works, one short chapter at a time.

The running renderer: a wooden hut stands in a dense grassy meadow dotted with red and white flowers, rocks and a marble sphere, under a blue sky with clouds. ImGui panels show sun-light controls on the left and four shadow-cascade depth maps on the right, with CPU and GPU frame times in the menu bar.

How to read this guide

You don't need any Vulkan, or any Rust, to start. You do need to be comfortable reading code in some language, and to know what a mesh, a texture and a camera are. If you remember OpenGL, even only by reputation, that's a useful starting point, and the guide will keep comparing against it.

The chapter times estimate a prose skim of the whole chapter. Studying the source alongside it will take longer; the overview alone is a shorter first pass. Each chapter has two layers:

Two kinds of side note appear throughout:

The guide explains the code as it is. It is not a build-along tutorial. Where the project's own notes say something is unfinished, the guide says so too. Use the links at each chapter's top to jump between its overview, source walkthrough and recap. At the end of each overview, a link takes you directly to the next overview.

To explore the renderer while reading, follow the setup instructions and run cargo run from the repository root. WASD moves, the mouse looks, U releases the pointer for menus, and Escape quits. The chapters include short observations and optional code experiments; you can read them without running the app.

Credits

The scene uses free assets made by other people, all released under CC0 1.0 (public domain):

Links to each rock model are in Chapter 12.