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:
- The big picture explains what that part of the renderer does, and why, in plain language and diagrams. If you want the high-level story, read only these sections, in order. They are written to stand on their own.
- Deeper dive walks through the actual source, excerpt by excerpt, with every excerpt labelled with its file and line numbers so you can open it alongside.
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.
Part 1 · Foundations
Part 2 · Talking to the GPU
- 03Instance, devices and queuesConnecting to the driver, picking a GPU, and getting somewhere to submit work.
- 04Surfaces and the swapchainHow images get from the GPU to the window, and what happens when the window changes.
- 05GPU memoryBuffers, images, memory types, and getting meshes and textures onto the GPU.
Part 3 · Drawing things
Part 4 · Making frames
Part 5 · The scene
- 11ShadowsCascaded shadow maps: rendering the world from the sun, four times.
- 12The main pass and the sceneThe camera, loading models, and the loop that draws them.
- 13A procedural worldA valley, a sky and a scatter of rocks, generated rather than modelled.
- 14GrassMillions of blades through instancing, levels of detail and wind.
- 15The ImGui overlayDrawing an immediate-mode UI on top of the scene in its own pass.
Part 6 · Bringing it together
Credits
The scene uses free assets made by other people, all released under CC0 1.0 (public domain):
- Hut and five rock models by Quaternius, from Poly Pizza.
- The sky panorama, Kloppenheim 05 (Pure Sky) by Greg Zaal, with the pure-sky edit by Jarod Guest, from Poly Haven.
Links to each rock model are in Chapter 12.