A Vulkan rendering engine in C#/.NET 9, built as a public learning journey. Each demo in this repo corresponds to a blog post on functionalrenderinglab.dev that walks through the technique it implements.
The architecture follows Functional Core / Imperative Shell: the render-graph
compiler, scene types, and UI reducers are pure and unit-tested without a GPU;
all Vulkan calls are confined to a single mutable kernel (GpuState) behind a
thin shell.
The engine is mid-roadmap. M0–M3 (triangle → G-Buffer → deferred shading) are
complete; M4 (basic lighting) and M5 (first paper: SSAO) are in progress. See
RenderLab-PRD.md for the full milestone plan and
docs/ARCHITECTURE.md for the module graph and per-frame
data flow.
- .NET 9 SDK
- A Vulkan-capable GPU and up-to-date drivers
- Vulkan SDK — provides
glslcfor shader compilation and the validation layers - Python 3 — invoked by
compile_shaders.pyto driveglslc
Targeted platforms: Windows and Linux on Vulkan 1.3.
# Compile GLSL shaders to SPIR-V (run once, and after any shader edit)
python src/RenderLab.Shaders/compile_shaders.py
# Build the solution
dotnet build code.slnDemos are selected by CLI argument to RenderLab.App:
dotnet run --project src/RenderLab.App -- <demo>| Demo | Command | What it shows |
|---|---|---|
| Triangle | dotnet run --project src/RenderLab.App -- triangle |
Minimal Vulkan pipeline — the "hello world" of the engine |
| G-Buffer | dotnet run --project src/RenderLab.App -- gbuffer |
Geometry pass writing position, normal, and albedo targets |
| Deferred | dotnet run --project src/RenderLab.App -- deferred |
Full deferred shading pipeline with Blinn-Phong lighting (default) |
Running with no argument launches the deferred demo. The rationale for the
per-article demo split is in
docs/DEMO-ARCHITECTURE.md.
The pure modules (RenderLab.Graph, RenderLab.Scene, RenderLab.Ui,
RenderLab.Functional) are fully tested without a GPU:
dotnet test code.slnsrc/RenderLab.App/— CLI dispatcher and per-article demo classes (Demos/)src/RenderLab.Gpu/— the only assembly that calls Silk.NET Vulkansrc/RenderLab.Graph/,RenderLab.Scene/,RenderLab.Ui/,RenderLab.Functional/— pure modulessrc/RenderLab.Papers/— pass modules (G-Buffer, deferred lighting, tonemap, debug viz)src/RenderLab.Shaders/— GLSL sources + SPIR-V build scriptdocs/— architecture, documentation rules, paper-implementation guidetests/— unit tests for the pure modules
RenderLab-PRD.md— goals, non-goals, milestones, design decisionsdocs/ARCHITECTURE.md— module graph, purity boundary, data flowdocs/ADDING-A-PAPER.md— how to implement a paper against the enginedocs/DEMO-ARCHITECTURE.md— why each blog post gets its own demo classdocs/QOL-STRATEGY.md— debug tooling and the iteration loopdocs/DOCUMENTATION-RULES.md— conventions fordocs/*.mdand XML<summary>
Apache License 2.0 — see LICENSE.