The Spartan Game Engine is an open source C++ based 3D game engine created by Panos Karabelas. Panos is a professional game developer working on rendering technology Codemasters. The Spartan engine is his personal playground for experimenting with game engine and rendering technology. The code is well architected and incredibly clear, making for an ideal place to learn game engine design.
Features of the Spartan Engine include:
- 10+ font file formats support (FreeType)
- 20+ audio file formats support (FMOD)
- 30+ image file formats support (FreeImage)
- 40+ model file formats support (Assimp)
- Vulkan and DirectX 11 backends (same HLSL shaders compile everywhere)
- Deferred rendering with transparency (under a single render path and using the same shaders)
- Principled BSDF supporting anisotropic, clearcoat and cloth materials (combined with things like normal mapping, parallax, masking, occlusion etc)
- Bloom (Based on a study of Resident Evil 2’s RE Engine)
- Volumetric lighting
- Lights with physical units (lux for directional, candelas for point and spot lights)
- Shadows with penumbra and colored translucency (Cascaded and omnidirectional shadow mapping with Vogel filtering)
- SSAO (Screen space ambient occlusion)
- SSR (Screen space reflections)
- SSS (Screen space shadows)
- TAA (Temporal anti-aliasing based on Uncharted 4)
- Physically based camera (Aperture, Shutter Speed, ISO)
- Depth of field (controlled by the aperture of the camera)
- Motion blur (controlled by the shutter speed of the camera)
- Real-time shader editor
- Custom mip chain generation (Higher texture fidelity using Lanczos3 scaling)
- Font rendering
- Frustum culling
- Post-process effects (Tone-Mapping, FXAA, Sharpening, Dithering, Chromatic aberration etc.)
- Physics (Rigid bodies, Constraints, Colliders)
- Entity-component system
- Event system
- Input (Keyboard, Mouse, Xbox controller)
- Debug rendering (Transform gizmo, scene grid, bounding boxes, colliders, raycasts, g-buffer visualization etc)
- Thread pool
- Engine rendered platform agnostic editor
- Profiling (CPU & GPU)
The code is written in C++, is open source under the MIT open source license and is available here. Binaries are available with Direct X11 and Vulkan rendering backends. If you want to get started with the Spartan engine, this is the easiest approach. Getting started with the source code requires Visual Studio 2019. Simply clone the repository and run the appropriate BAT file for the renderer you are interested in, then open the generated SLN file in Visual Studio.
If you have any questions, check out the Spartan game engine Discord server available here. You can learn more about the Spartan Engine and see it in action in the video below.