Feature-rich, performant, easy to use, extensible desktop game development framework for D language, an SDL3 port of Dagon Engine 1.x. Works on Windows and Linux.
Note: this project is not connected to Dagon engine by Senscape.
Note: Dagon 2 is still in active development. Not all features and extensions of Dagon 1.0 are ported yet.
New features and major changes from Dagon 0.x/1.x:
- Core
- Dagon now uses SDL3
- Window minimize/restore events
- Nanosecond-precision timer
- CPU-friendly frame scheduler
- Mailbox Vsync support, significantly reducing input lag
- HiDPI logic is now handled partly by the engine itself due to API changes in SDL3
- Referencing support in *.conf files syntax. Any property can be reused like a variable
- Many classes across the engine now use a flat hash map (with xxHash64 hash function) instead of
Dict, achieving 36x better performance on insertion and 15x on searching compared to Dagon 1.x
- Assets
- Asset loading is simplified, there are no separate
loadThreadSafePartandloadThreadUnsafePartmethods, just oneload - Own 3D model format - DAF (Dagon Asset Format), optimized for very fast loading
- Assimp integration is now a core feature
- glTF and other model formats support now rely on Assimp
- Texture loader is fully based on SDL3_Image and doesn't use
dlib.image.io - KTX support is now a core feature
- Improved DDS loader. Many new DXGI formats support
- BC5 texture compressor
- Built-in texture caching
- Abstract resource cache (
dagon.resource.cache) that can be used for any file types
- Asset loading is simplified, there are no separate
- Render
- Reimplemented
dagon.render. Deferred renderer, post-processing renderer and presentation renderer are now combined into one - Renderer now leverages SDL GPU, targeting Vulkan
- Improvements and optimizations in almost every stage of the renderer. Many new features such as irradiance mapping, multiple scattering, specular occlusion, and adjustable IOR. Normals are now stored in world space to achieve frame coherence and mitigate R10G10B10A2 rounding errors. All stochastic techniques now use permuted congruential generator as a hash function
- Renderer quality profiles support:
LowQuality,HighQuality,UltraQuality - Stochastic screen-space reflections (SSSR) support
- HDR (scRGB) output support
- The renderer now uses separate irradiance cubemap
- BRDF LUT is now generated at runtime instead of loading from
data/__internal - Temporal SSAO support
- Fog effect is now applied in a separate pass. Ground fog support
- Shadeless materials in deferred pipeline
- Reimplemented
- Graphics components
- Shader workflow is now based on GLSL 4.60 and includes built-in GLSL to SPIR-V compiler. SPIR-V modules are cached to disk for reuse
- Semantic of
SceneandWorldclasses is changed.Sceneis now just a container for Entities and other graphical data; for user input and game logicsWorldshould be used Environmentclass is gone, all environment properties are now part of theSceneclass- Better handling of transparent objects. Transparent and opaque meshes are now differentiated per-material, not per-entity. This simplifies asset import and allows mixing transparent and opaque face groups in the same mesh
- All Entities are static by default, and their model matrices are not recalculated each frame to reduce CPU overhead. For dynamic updates enable
Entity.dynamicor use customEntityController - New camera animation system:
CameraControllerthat interpolates a camera transformation between two independent states defined byCameraDriverobjects. This allows to implement complex in-game transitions and cutscene animations - Inertial rotation support in
FirstPersonViewController - GPU texture resampling now supports separable Lanczos filter and uses it by default
- Post-processing
- Tonemapping is entirely based on AgX. Legacy tonemappers were removed
- Subpixel Morphological Anti-Aliasing (SMAA) support
- Radial optical distortion support
- Direct GPUImage LUT support was removed, it now requires conversion to 3D LUT
- Physics
- Jolt Physics is now built-in as
dagon.joltpackage
- Jolt Physics is now built-in as
- Scripting
- Built-in GScript3 virtual machine and scripting API.
- Extensions
dagon2:imgui- now provides a built-in UI boilerplate classdagon2:audio- underlying sound engine (SoLoud) is updated with SDL3 and DirectSound backendsdagon:openvris not available anymore because interop between SDL GPU and OpenVR is not possible; SDL deliberately abstracts and hides the underlying native graphics API handles. OpenXR support is planned for the long term, but will not happen until SDL 3.6.0.
Realistic minimum system requirements (for Full HD rendering at 60 fps):
- CPU: Intel Core i3-10100 / AMD Ryzen 3 3100
- RAM: application-dependent, usually 8 Gb minimum
- GPU: Vulkan-capable, tested on GeForce RTX 3050
- VRAM: application-dependent, 6 Gb minimum
- OS: 64-bit Windows 10 or higher / Linux.
TODO
- SDL 3.4
- SDL_Image 3.2
- FreeType 2.8.1
- GLSLang
- SPIRV-Cross
- Assimp
- libktx
- Jolt Physics via joltc wrapper
- libwebp for WebP support (optional)
- libtiff for TIFF support (optional)
- Dear ImGui via cimgui wrapper (optional)
- PhysFS (optional)
- SoLoud (optional)
- libVLC (optional)
Dependencies are automatically deployed on 64-bit Windows and Linux. Under Linux, if you want to use local libraries in Windows way (from application's working directory rather than from the system), add the following to your dub.json:
"lflags-linux": ["-rpath=$$ORIGIN"]
On Windows, some dependencies require Visual C++ v14 Redistributable. You can download an official installer here. It is recommended to bundle vc_redist.x64.exe with your application's installer for end users.
- The engine doesn't support macOS yet.
- Although SDL GPU is a multi-backend API, Dagon 2 currently targets only Vulkan backend.
dagon:openvrextension from Dagon 1.x won't be ported because interop between SDL GPU and OpenVR is not possible; SDL deliberately abstracts and hides the underlying native graphics API handles. OpenXR support is planned for the long term, but will not happen until SDL 3.6.0.
API reference in HTML format can be generated from source code using ddox (dub build -b ddox). Be aware that documentation is currently incomplete.
Distributed under the Boost Software License, Version 1.0 (see accompanying file COPYING or at http://www.boost.org/LICENSE_1_0.txt). Third-party dependencies are distributed under their own licenses.



