Rendering Subsystem
Pipeline overview
Glitter uses a deferred PBR rendering pipeline over Vulkan with VMA-managed GPU memory.
| Pass | Description |
|---|---|
| G-Buffer | 4 MRTs: position, normal+AO, albedo+roughness, emissive+metallic |
| Shadow maps | 4-cascade CSM (directional) + omnidirectional cubemap shadows (point lights) |
| IBL | Irradiance map + pre-filtered specular + BRDF LUT split-sum (Fdez-Aguera multi-scattering) |
| Deferred lighting | Directional + point + spot lights with Cook-Torrance PBR BRDF |
| Reflection probes | Per-probe cubemaps, nearest-probe selection, global fallback |
| Forward pass | Transparent / alpha-masked objects rendered after deferred lighting |
| Post-processing | ACES Hill tonemapping, exposure, FXAA |
| Debug channels | Real-time visualisation of individual G-Buffer channels (albedo, normals, roughness, metallic, AO, etc.) |
Vulkan backend
The engine uses Vulkan as its sole rendering backend (minimum Vulkan 1.1). GPU capabilities are enumerated before device selection, preferring discrete GPUs.
Key Vulkan features used:
- VMA (Vulkan Memory Allocator) — all GPU memory allocation goes through VMA; no manual
vkAllocateMemorycalls - Push descriptors — for frequently-changing per-draw bindings
- Shader demote to helper invocation — for PBR shader anti-aliasing
- GPU capability enumeration — device selection based on feature support
Renderer registry
Renderers are registered via assemblyRegistration() after logging is configured. The active renderer is selected from engine.config.json with a fallback to the default. Adding a new renderer requires only its registration — no changes to the engine core.
Shader system
All shaders are written in Slang and compiled to SPIR-V at load time. Shader configuration is managed through JSON descriptor files. See the dedicated Shader System page for details.
Debug channel viewer
The Vulkan renderer includes a debug channel viewer accessible via the developer console. When a debug channel is active, tonemapping and gamma correction are bypassed to show raw G-Buffer data.
| Channel | Content |
|---|---|
| Albedo | Base colour from the G-Buffer |
| Normals | World-space normals |
| Roughness | Roughness channel |
| Metallic | Metallic channel |
| AO | Ambient occlusion |
| Emissive | Emissive output |
| Position | World-space position |