about
Manta is C++ game engine & build system currently under development designed to achieve the following:
Provide a simple library for creating games quickly
Provide abstraction layers for cross-platform compilation (Windows/MacOS/Linux) and graphics API backends (OpenGL, DirectX, Vulkan, Metal)
Provide a custom build system prioritizing modularity and fast compile times
Employ build-time code generation for engine systems (boilerplate internals of object, asset, and render systems, etc.)
Have an “IDE-like” experience facilitated by a Visual Studio Code plugin (build + compile + run, debugging, *project*/workspace navigation, IntelliSense)
Manta is a personal project not meant for open use. That said, an early fork of the source is available below to browse as you please.
SHOWCASE: manta “UNIVERSAL” SHADER LANGUAGE
Manta Engine features a custom shader language which cross-compiles to .glsl, .hlsl, .metal for the respective graphics backends. The goal is to streamline the shader authoring and maintenance workflows within the engine’s graphics API-agnostic rendering layer. With this “universal” shader language, creating and maintaining shaders is as simple as modifying single ‘.shader’ files.
During the code generation stage of build pipeline, miscellaneous internal C++ “boilerplate” engine code is generated from the shader metadata. This includes shader, texture, and render target bindings; vertex input layouts; CPU-side (C++) constant/uniform buffer interfaces; and more. The ‘.shader’ files also support C preprocessor directives such as #includes, #if, etc.
As a convenience, ‘.shader’ files can utilize a standard C++ language server for syntax highlighting (e.g. IntelliSense) by #including <shader_api.hpp>. This optional header simply contains forward declarations for intrinsic functions, types, and macros and is ignored by the compiler. The syntax of the language is inspired by C and HLSL.
The shader pipeline works as follows:
build tool searches for '.shader' files
build tool runs msvc/clang/gcc preprocessor on the '.shader' to resolve preprocessor directives, includes, and comments
build tool parses the preprocessed output and and builds an AST representation of the shader program
build tool generates .glsl/.hlsl/.metal output shader code from the AST
build tool generates internal C++ engine code from the AST
build tool compiles and packs the .glsl/.hlsl/.metal shaders into the project binary