PanosK92/SpartanEngine

A game engine with a fully bindless, GPU-driven renderer featuring real-time path-traced global illumination, hardware ray tracing, and a physics simulation running at 200Hz, built over 12+ years of R&D

3,134

stars

7,871

commits

C++

primary language

Sep 10, 2026

updated

panoskarabelas.com
atmospheric-scattering
bindless
bsdf
car-simulation
cpp
cutting-edge
ecs
game-engine
gpu-driven
imgui
livestream
path-tracing
physx
ray-tracing
restir-gi
spartan
ssao
taa
vulkan
xess

README

Spartan Engine

One engineer. Twelve years. A bindless, GPU-driven engine with real-time path-traced global illumination.

A personal R&D engine, not a commercial product. No roadmap promises, no support queue, no compromises on the vision.

Build Status Discord License

Discord  ·  X  ·  Wiki  ·  Issues


The Engine

Spartan started as a university project. Ten years of nights and weekends later, its rendering technology runs in Godot Engine and S.T.A.L.K.E.R. Anomaly, ships in a published programming book, and anchors a community of 600+ engineers on Discord.

This is what a codebase looks like when a single person owns every line for a decade: no legacy committees, no half-migrated architectures, no "we'll fix it in the next version." One philosophy applied without compromise: favor real-time over baked, dynamic over static, modern over safe. Every system here exists to serve that.

There is a destination that gives all this tech a purpose. Curious? Read the plan →


The Trailer

Engine Trailer


Worlds

Launch the engine and choose from a selection of default worlds. Nothing is a canned demo—every world is physics-enabled. Walk around, pick up objects with your mouse, or take a car for a spin.

Rendering

The renderer is built around one principle: the GPU owns the data. Every resource (geometry, materials, textures, lights, transforms, AABBs) lives in persistent, globally accessible buffers. No per-draw descriptor updates, no per-draw resource binding, no CPU-side draw loops.

Architecture

  • Zero-binding draw path, all per-draw data lives in a single bindless storage buffer, push constants carry only an index
  • Single global vertex and index buffer for all geometry (inspired by id Tech), with vertex pulling that bypasses the Input Assembler and is shared by rasterization and ray tracing
  • GPU-driven indirect rendering with per-meshlet frustum, Hi-Z occlusion, and backface cone culling, the CPU issues a single DrawIndexedIndirectCount per pass
  • Meshlet clustering via meshoptimizer, no mesh shader dependency
  • Bindless everything: materials, lights, samplers, uber shaders, minimal PSO permutations
  • Universal HLSL compiled for both Vulkan (SPIR-V) and DirectX 12
  • GPU-side asset processing: mip generation (FidelityFX SPD) and texture compression (Compressonator) at load time, not baked offline
  • Unified deferred rendering, opaque and transparent surfaces share the same BSDF and render path
  • Async compute for SSAO and screen-space shadows, parallel with shadow rasterization

Lighting and Global Illumination

  • ReSTIR path tracing with spatiotemporal reservoir resampling for real-time multi-bounce global illumination
  • Clustered deferred shading with a GPU-built logarithmic-Z grid and cone-vs-AABB culling for spots, scales to many local lights at near-constant per-pixel cost
  • Hardware ray-traced reflections and shadows via ray queries
  • Atmospheric scattering and image-based lighting with bent normals
  • Volumetric clouds (Nubis-style) baked into the sky panorama, with cumulus and cirrus layers, multi-scatter lighting and aerial perspective
  • Froxel volumetric fog, a single view-aligned volume for height and distance fog, sun shafts, and underwater caustic shafts, with temporal reprojection and shadowing
  • FFT ocean with a Tessendorf spectrum and multi-cascade IFFT in compute, driving a camera-following clipmap with choppy displacement, dynamic normals and crest foam
  • Screen-space shadows (inspired by Days Gone) and XeGTAO ambient occlusion
  • Shadow map atlas with fast filtering and penumbra estimation

Performance and Upscaling

  • Variable rate shading and dynamic resolution scaling
  • TAAU, temporal anti-aliasing with built-in upsampling, Halton-jittered with variance-clip history reprojection
  • Intel XeSS 3 upscaling
  • FXAA
  • Custom breadcrumbs for GPU crash tracing and post-mortem debugging

Camera and Post-Processing

  • Physically based camera with auto-exposure and physical light units (lumens and kelvin)
  • Tonemappers: ACES, AgX, Gran Turismo 7 (default)
  • HDR10 output
  • Bloom, motion blur, depth of field, chromatic aberration, film grain, sharpening (CAS)

Car Simulation — 200Hz

A full vehicle dynamics simulation running inside the PhysX fixed-timestep loop. Not a gameplay approximation—the kind of model you'd expect from a dedicated racing sim, embedded in a general-purpose engine.

SystemDetails
TiresPacejka MF 5.2 with combined slip, thermal model, pressure, wear, multiple surfaces
SuspensionConvex hull sweep contact, spring-damper, anti-roll bars, bump stops, bump steer, camber/toe
Weight transferGeometric + elastic lateral split via roll center heights and roll stiffness
DrivetrainEngine torque curve, turbo, 7-speed gearbox, rev-match, open/locked/LSD differentials, RWD/FWD/AWD
BrakesThermal model with fade, front/rear bias, slip-threshold ABS
AerodynamicsDrag, front/rear downforce, ground effect, DRS, rolling resistance
SteeringAckermann geometry, high-speed reduction, self-aligning torque
AssistsABS, traction control, handbrake
IntegrationSemi-implicit Euler with consolidated net-torque per wheel
InputControllers and steering wheels with haptic feedback
CameraGT7-inspired chase camera with speed-based dynamics

Engine Systems

SystemDetails
ParticlesGPU-driven with compute emission and simulation, depth-buffer collision, soft blending
AnimationFull skeletal animation: keyframed clips, crossfade blending, four-bone skinning, and two-bone inverse kinematics with ground-aware foot planting
PhysicsPhysX with rigid bodies, character kinematics, and vehicle dynamics
ScriptingLua 5.4 via Sol2 with full engine API and lifecycle callbacks
Audio3D positional audio, streaming, reverb, procedural synthesis via SDL3
InputKeyboard, mouse, controllers, and steering wheels with haptic feedback
Entity systemComponent-based with transform hierarchies, prefabs, and XML serialization
Procedural roadsCatmull-Rom spline roads with extruded profiles, terrain conforming, instanced prop placement, and path followers
CinematicsCamera cut sequencer with entity tracking, spline-driven movement, and exact cut timing
ThreadingHardware-aware thread pool with parallel loops and nested parallelism detection
VR (WIP)OpenXR with multiview single-pass stereo (Vulkan and DirectX 12)
ProfilingNsight/RGP-style timeline with separate graphics and async compute lanes, RenderDoc integration, GPU/CPU memory fragmentation map
Asset import40+ model formats (Assimp), 30+ image formats (FreeImage), 10+ font formats (FreeType)
EditorImGui-based with hierarchy, asset browser, inspector, script and shader editors, gizmos, profiler, memory fragmentation viewer

Getting Started

Building

One-click project generation—see the Building Guide for details.

Learning the Engine

Start with Engine.cpp, it is the engine entry and the best place to learn the startup path. For gameplay scripting, check out the Lua Scripting Guide, it covers the full API, lifecycle callbacks, and examples.


Podcast

Exploring the tech world and beyond

Meeting the brightest minds across cutting-edge industries.

📺 Watch on YouTube
🎧 Listen on Spotify

Community

Contributing

Contributors get access to exclusive perks designed to accelerate learning and skill development.

Read the Contributing Guide →

Sponsorship

I cover the Dropbox hosting that makes the one-click setup work. If Spartan has taught you something, or if you just want to fuel another decade of this, sponsorship goes directly into keeping the lights on and the project moving.


Projects Using Spartan

ProjectDescription
Godot EngineIntegrates Spartan's TAA (view source)
S.T.A.L.K.E.R. AnomalyRendering addon using Spartan's source (ModDB)
Programming BookJesse Guerrero's beginner programming book features Spartan's code and community
University ThesisOriginally created as a portfolio piece while studying at the University of Thessaly with Professor Fotis Kokkoras

Using code from Spartan? Reach out, I'd love to showcase your project!


License

MIT License, free to use with attribution.

Contributors

PanosK92

7,650 commits

IkerGalardi

72 commits

pattakosn

39 commits

Nickelium

19 commits

PanosK92/SpartanEngine

A game engine with a fully bindless, GPU-driven renderer featuring real-time path-traced global illumination, hardware ray tracing, and a physics simulation running at 200Hz, built over 12+ years of R&D

3,134

stars

7,871

commits

C++

primary language

Sep 10, 2026

updated

panoskarabelas.com
atmospheric-scattering
bindless
bsdf
car-simulation
cpp
cutting-edge
ecs
game-engine
gpu-driven
imgui
livestream
path-tracing
physx
ray-tracing
restir-gi
spartan
ssao
taa
vulkan
xess

README

Spartan Engine

One engineer. Twelve years. A bindless, GPU-driven engine with real-time path-traced global illumination.

A personal R&D engine, not a commercial product. No roadmap promises, no support queue, no compromises on the vision.

Build Status Discord License

Discord  ·  X  ·  Wiki  ·  Issues


The Engine

Spartan started as a university project. Ten years of nights and weekends later, its rendering technology runs in Godot Engine and S.T.A.L.K.E.R. Anomaly, ships in a published programming book, and anchors a community of 600+ engineers on Discord.

This is what a codebase looks like when a single person owns every line for a decade: no legacy committees, no half-migrated architectures, no "we'll fix it in the next version." One philosophy applied without compromise: favor real-time over baked, dynamic over static, modern over safe. Every system here exists to serve that.

There is a destination that gives all this tech a purpose. Curious? Read the plan →


The Trailer

Engine Trailer


Worlds

Launch the engine and choose from a selection of default worlds. Nothing is a canned demo—every world is physics-enabled. Walk around, pick up objects with your mouse, or take a car for a spin.

Rendering

The renderer is built around one principle: the GPU owns the data. Every resource (geometry, materials, textures, lights, transforms, AABBs) lives in persistent, globally accessible buffers. No per-draw descriptor updates, no per-draw resource binding, no CPU-side draw loops.

Architecture

  • Zero-binding draw path, all per-draw data lives in a single bindless storage buffer, push constants carry only an index
  • Single global vertex and index buffer for all geometry (inspired by id Tech), with vertex pulling that bypasses the Input Assembler and is shared by rasterization and ray tracing
  • GPU-driven indirect rendering with per-meshlet frustum, Hi-Z occlusion, and backface cone culling, the CPU issues a single DrawIndexedIndirectCount per pass
  • Meshlet clustering via meshoptimizer, no mesh shader dependency
  • Bindless everything: materials, lights, samplers, uber shaders, minimal PSO permutations
  • Universal HLSL compiled for both Vulkan (SPIR-V) and DirectX 12
  • GPU-side asset processing: mip generation (FidelityFX SPD) and texture compression (Compressonator) at load time, not baked offline
  • Unified deferred rendering, opaque and transparent surfaces share the same BSDF and render path
  • Async compute for SSAO and screen-space shadows, parallel with shadow rasterization

Lighting and Global Illumination

  • ReSTIR path tracing with spatiotemporal reservoir resampling for real-time multi-bounce global illumination
  • Clustered deferred shading with a GPU-built logarithmic-Z grid and cone-vs-AABB culling for spots, scales to many local lights at near-constant per-pixel cost
  • Hardware ray-traced reflections and shadows via ray queries
  • Atmospheric scattering and image-based lighting with bent normals
  • Volumetric clouds (Nubis-style) baked into the sky panorama, with cumulus and cirrus layers, multi-scatter lighting and aerial perspective
  • Froxel volumetric fog, a single view-aligned volume for height and distance fog, sun shafts, and underwater caustic shafts, with temporal reprojection and shadowing
  • FFT ocean with a Tessendorf spectrum and multi-cascade IFFT in compute, driving a camera-following clipmap with choppy displacement, dynamic normals and crest foam
  • Screen-space shadows (inspired by Days Gone) and XeGTAO ambient occlusion
  • Shadow map atlas with fast filtering and penumbra estimation

Performance and Upscaling

  • Variable rate shading and dynamic resolution scaling
  • TAAU, temporal anti-aliasing with built-in upsampling, Halton-jittered with variance-clip history reprojection
  • Intel XeSS 3 upscaling
  • FXAA
  • Custom breadcrumbs for GPU crash tracing and post-mortem debugging

Camera and Post-Processing

  • Physically based camera with auto-exposure and physical light units (lumens and kelvin)
  • Tonemappers: ACES, AgX, Gran Turismo 7 (default)
  • HDR10 output
  • Bloom, motion blur, depth of field, chromatic aberration, film grain, sharpening (CAS)

Car Simulation — 200Hz

A full vehicle dynamics simulation running inside the PhysX fixed-timestep loop. Not a gameplay approximation—the kind of model you'd expect from a dedicated racing sim, embedded in a general-purpose engine.

SystemDetails
TiresPacejka MF 5.2 with combined slip, thermal model, pressure, wear, multiple surfaces
SuspensionConvex hull sweep contact, spring-damper, anti-roll bars, bump stops, bump steer, camber/toe
Weight transferGeometric + elastic lateral split via roll center heights and roll stiffness
DrivetrainEngine torque curve, turbo, 7-speed gearbox, rev-match, open/locked/LSD differentials, RWD/FWD/AWD
BrakesThermal model with fade, front/rear bias, slip-threshold ABS
AerodynamicsDrag, front/rear downforce, ground effect, DRS, rolling resistance
SteeringAckermann geometry, high-speed reduction, self-aligning torque
AssistsABS, traction control, handbrake
IntegrationSemi-implicit Euler with consolidated net-torque per wheel
InputControllers and steering wheels with haptic feedback
CameraGT7-inspired chase camera with speed-based dynamics

Engine Systems

SystemDetails
ParticlesGPU-driven with compute emission and simulation, depth-buffer collision, soft blending
AnimationFull skeletal animation: keyframed clips, crossfade blending, four-bone skinning, and two-bone inverse kinematics with ground-aware foot planting
PhysicsPhysX with rigid bodies, character kinematics, and vehicle dynamics
ScriptingLua 5.4 via Sol2 with full engine API and lifecycle callbacks
Audio3D positional audio, streaming, reverb, procedural synthesis via SDL3
InputKeyboard, mouse, controllers, and steering wheels with haptic feedback
Entity systemComponent-based with transform hierarchies, prefabs, and XML serialization
Procedural roadsCatmull-Rom spline roads with extruded profiles, terrain conforming, instanced prop placement, and path followers
CinematicsCamera cut sequencer with entity tracking, spline-driven movement, and exact cut timing
ThreadingHardware-aware thread pool with parallel loops and nested parallelism detection
VR (WIP)OpenXR with multiview single-pass stereo (Vulkan and DirectX 12)
ProfilingNsight/RGP-style timeline with separate graphics and async compute lanes, RenderDoc integration, GPU/CPU memory fragmentation map
Asset import40+ model formats (Assimp), 30+ image formats (FreeImage), 10+ font formats (FreeType)
EditorImGui-based with hierarchy, asset browser, inspector, script and shader editors, gizmos, profiler, memory fragmentation viewer

Getting Started

Building

One-click project generation—see the Building Guide for details.

Learning the Engine

Start with Engine.cpp, it is the engine entry and the best place to learn the startup path. For gameplay scripting, check out the Lua Scripting Guide, it covers the full API, lifecycle callbacks, and examples.


Podcast

Exploring the tech world and beyond

Meeting the brightest minds across cutting-edge industries.

📺 Watch on YouTube
🎧 Listen on Spotify

Community

Contributing

Contributors get access to exclusive perks designed to accelerate learning and skill development.

Read the Contributing Guide →

Sponsorship

I cover the Dropbox hosting that makes the one-click setup work. If Spartan has taught you something, or if you just want to fuel another decade of this, sponsorship goes directly into keeping the lights on and the project moving.


Projects Using Spartan

ProjectDescription
Godot EngineIntegrates Spartan's TAA (view source)
S.T.A.L.K.E.R. AnomalyRendering addon using Spartan's source (ModDB)
Programming BookJesse Guerrero's beginner programming book features Spartan's code and community
University ThesisOriginally created as a portfolio piece while studying at the University of Thessaly with Professor Fotis Kokkoras

Using code from Spartan? Reach out, I'd love to showcase your project!


License

MIT License, free to use with attribution.

Contributors

PanosK92

7,650 commits

IkerGalardi

72 commits

pattakosn

39 commits

Nickelium

19 commits

Languages

C++

81.2%

HLSL

6.8%

JavaScript

5.5%

C

5.2%