README.md

July 13, 2026 · View on GitHub

Luth Logo

Version Build Status
Language Platform License

C++ game engine built to explore high-performance architecture.
Currently under active development, serves as both a learning platform and research project.

Or it might just be a playground to test my sanity.

Important

My original Bachelor's Thesis version is archived in the thesis branch.

Luth editor rendering Castle Dimitrescu with ray-traced global illumination


Why Luth?

Honestly? I just really love this stuff.

It started with my Bachelor's Thesis: a dual-renderer engine benchmarking Vulkan path tracing against traditional OpenGL PBR. The focus was purely real-time graphics, so the architecture underneath was single-threaded. It worked, and I had a blast building it!

Then I watched Christian Gyrling's GDC talk, Parallelizing the Naughty Dog Engine Using Fibers, and saw how they saturate every core on the CPU. It made me realise how much I still had left to explore.

So I restarted Luth from scratch to chase exactly that: fiber-based job systems, lock-free memory, bindless Vulkan, and hardware ray tracing. It is absolutely over-engineered for a solo project, but that’s the point.


Amazon Bistro at night lit by hundreds of clustered lights Emissive sphere lighting cloth drapes, path-traced
Bistro · clustered Forward+, ray-traced sun shadows Emissive meshes · ReSTIR area lights, path-traced
Subsurface-scattering skin with the node material graph open Sponza with volumetric god rays
Subsurface skin · authored in the node material graph Volumetric god rays · froxel fog

Rigged character playing a skeletal animation
Skeletal animation and GPU skinning

More shots land with each release.


Shuddup! how build??

Prerequisites:

  • OS: Windows 10 / 11
  • Compiler: MSVC (v143+) or Clang (C++20-compliant)
  • GPU: Hardware ray tracing required (VK_KHR_ray_query + acceleration structures). NVIDIA RTX 20-series or newer, AMD RX 6000+, or Intel Arc
  • SDK: Vulkan SDK 1.3+, with dynamicRendering, timelineSemaphore, descriptor indexing (UBO update-after-bind), and the KHR ray-tracing extensions

Steps:

  1. Clone with submodules
    git clone --recursive https://github.com/Hekbas/Luth.git
    
  2. Generate the VS solution
    scripts/setup/setup_windows.bat
    
  3. Build. Either open Luth.sln in Visual Studio 2022, or run the headless script:
    scripts/build/build_windows.bat
    

The editor binary lands at bin/windows-x86_64/Debug/Runtime/Luthien.exe.


Architecture

The short tour. Full detail lives in ARCHITECTURE.md and the per-system references under docs/development/arch/.

  • Fiber job system. One worker thread per core. Logical tasks run as lightweight, migratable fibers that yield to the scheduler instead of blocking the OS, so the CPU stays near-saturated. FLS, Chase-Lev work-stealing deques, lock-free queues, spin-locks on the hot path. The context switch is hand-written x86-64 assembly over VirtualAlloc stacks, so every fiber stack is AddressSanitizer-trackable.
  • Pipelined frames. Game (N), Render (N-1), and GPU (N-2) run at the same time. The handoff between stages is an immutable per-frame snapshot, never shared mutable state.
  • Tagged allocators. No new / delete on the hot path. A Naughty Dog-style Onion/Garlic split: CPU and GPU tagged page allocators (bulk-freed by tag, GPU pages retiring on the timeline) plus a per-frame linear allocator.
  • Bindless Vulkan 1.3. Dynamic rendering and timeline semaphores only, no legacy render passes or fences. One global texture array and buffer device addresses mean draws carry integer indices instead of rebinding.
  • Render graph. Each frame builds a DAG of passes that declare their reads and writes. The graph solves barriers, culls unused passes, and records commands in parallel across workers.

The scheduler, allocators, and lock-free primitives run under a dedicated 28-case ASan stress harness.


Features

Rendering

Real-Time Ray TracingHardware ray query: RT sun shadows, ReSTIR direct + global illumination, stochastic RT reflections. Per-frame TLAS, bindless geometry table
Path-Traced ReferencerayQuery megakernel with multi-bounce next-event estimation and progressive accumulation. Ground truth to A/B the real-time path
DenoisingSVGF across three channels (diffuse DI, indirect GI, specular) behind a swappable IDenoiser
Clustered Forward+Log-slice light clusters with a slim G-buffer prepass, ECS-driven
LightsDirectional sun, plus clustered and GPU-culled point and spot lights
PBR MaterialsCook-Torrance metallic/roughness with Opaque, Cutout, and order-independent Transparent modes
Node Material EditorBlender-style graph that generates Slang per material, identical raster and RT output, live recompile, exposed parameters
Shading ModelsClear coat, anisotropy, dielectric transmission (glass), sheen (cloth), and subsurface scattering (skin), across the raster and path-traced paths
Surface DetailParallax occlusion mapping and projected decals, authored in the node graph
ShadowsRT ray-query sun shadows by default; 4-cascade PSSM kept as an A/B toggle
Volumetric FogFroxel grid: inject, integrate, temporal resolve, composite. Optional per-froxel RT fog shadows
Ambient OcclusionGTAO half-res compute (prefilter, horizon integral, bilateral denoise)
IBLHDR skybox, diffuse irradiance, pre-filtered specular, BRDF LUT, split-sum ambient
Anti-AliasingTAA plus specular anti-aliasing
Vertex DeformationGPU compute deformation shared by raster and the RT BLAS, driven by procedural wind
GPU CullingCompute frustum culling per cascade and main scene, indirect draws throughout
Async ComputeThree-queue Vulkan topology (graphics, async compute, transfer); GTAO and RT chains overlap on the compute queue
BindlessBuffer device addresses and one global 16k-texture array; integer material and texture indices
Post-ProcessingHDR pipeline: bloom, ACES and AgX tonemap operators, vignette, grain, chromatic aberration
ShadersSlang-only asset pipeline with UUIDs, hot-reload, and SPIRV-Cross reflection
Pipeline CacheDisk-persisted, lazy variant creation, targeted hot-reload invalidation

Animation

SamplingFiber-parallel keyframe evaluation
GPU SkinningBone-matrix SSBO, vertex-shader skinning
BlendingSQT interpolation, crossfade transitions, layered override with bone masks
Root MotionExtracted and applied to the entity transform
DebugBone overlay in the editor viewport

Physics

BackendJolt Physics, jobified onto the fiber scheduler
Rigid BodiesStatic / Kinematic / Dynamic with CCD; primitive, convex-hull, and mesh shapes
MaterialsUUID-keyed friction / restitution / density with hot-reload
Character ControllerKinematic capsule (JPH::CharacterVirtual) with stair-stepping and stick-to-floor
QueriesRaycast and overlap (box / sphere / capsule), layer-mask filtered
EventsContact and trigger add/remove, drained per frame
Debug DrawWire colliders colored by motion state or ground state

Asset Pipeline

Asset DatabaseUUID registry with .meta sidecars; importers for shaders, textures, models, materials, animations
Smart ImportMulti-strategy texture discovery, drag-and-drop with eager import, texture remap dialog
Texture CompressionImport-time BCn: BC7 for color, BC5 for normals, uploaded on the transfer queue
Model ImportFull DCC hierarchy, cameras, and lights, not just meshes; render-mode and cull flags from the source
Hot ReloadFileWatcher-driven live reload for shaders, textures, and project files
Scene FormatJSON .luth with dirty tracking and native file dialogs

Editor

Scene InteractionMouse picking, selection outlines, multi-select, shade modes (Lit / Wireframe / Unlit and debug views)
InspectorMaterial editor, animation controls, light and shadow settings, per-component copy/paste, Add Component
Live PreviewOrbit-camera 3D preview for material and model assets
Play ModeEditing / Playing / Paused state machine, JSON scene snapshot, transport bar
Game PanelCamera-driven runtime view with letterbox, no overlays
Project PanelFolder navigation, search, rendered thumbnails, context menus
Undo / RedoCommand pattern with UUID entity resolution, gizmo-drag coalescing, compound commands
Frame DebuggerFreeze a frame, scrub through every draw, replay any single one to see what it did
ProfilerScheduler, memory, and per-pass GPU dashboard with fiber-aware instrumentation
GPU Crash DebuggingNsight Aftermath device-lost dumps plus tiered Vulkan validation
ConsolePer-subsystem log channels with level filter and search
PersistenceNamed workspaces: window layouts and panel state saved across sessions

Roadmap

See the development roadmap for completed work and version history, and FUTURE.md for the long-tail wishlist.

Next up: GPU particle system, scripting (C# or Lua), prefab system, animation blend trees and IK, procedural sky.


Dependencies

Luth is built on the shoulders of giants:

Vulkan SDKRendering backend
SlangShader language and compiler (SPIR-V)
SPIRV-CrossShader reflection
VMAVulkan memory allocator
EnTTEntity-Component-System
ImGuiEditor GUI
ImGuizmoGizmos and the node graph editor widget
Phosphor IconsEditor icon set
TracyFrame profiler
Nsight AftermathGPU crash dumps on device-lost (optional)
GLFWWindowing and input
GLMMath
spdlogLogging
assimpModel importing
stb_imageImage loading
bc7enc_rdoBCn texture compression (BC7 / BC5 / BC1)
nlohmann/jsonJSON serialization
Jolt PhysicsRigid-body physics

References & Further Reading

Luth implements ideas from these papers and talks. If you want to understand a system, start here.

AreaSource
Fiber job systemGyrling, Parallelizing the Naughty Dog Engine Using Fibers (GDC 2015)
Clustered Forward+Olsson, Billeter, Assarsson, Clustered Deferred and Forward Shading (HPG 2012)
ReSTIR direct lightingBitterli et al., Spatiotemporal Reservoir Resampling (SIGGRAPH 2020)
ReSTIR global illuminationOuyang et al., ReSTIR GI: Path Resampling for Real-Time Path Tracing (HPG 2021)
SVGF denoisingSchied et al., Spatiotemporal Variance-Guided Filtering (HPG 2017)
Ground-truth AOJimenez et al., Practical Real-Time Strategies for Accurate Indirect Occlusion (SIGGRAPH 2016)
Volumetric fogWronski, Volumetric Fog (SIGGRAPH 2014); Hillaire, Physically Based Volumetric Rendering (2015)
Temporal AAKaris, High-Quality Temporal Supersampling (SIGGRAPH 2014)
Specular AATokuyoshi, Kaplanyan, Improved Geometric Specular Antialiasing (i3D 2019)
PBR shadingBurley, Physically Based Shading at Disney (2012); Karis, Real Shading in Unreal Engine 4 (2013)
TonemappingTroy Sobotka, AgX

License

Released under the MIT License.