Turnip is my favorite toy game engine. It features an unecessarily complicated RHI (a fancy way of saying it can run both Vulkan and Modern OpenGL), a suboptimal Lua engine, and several other cool things.
Turnip doesn't have prebuilt binaries yet, so if you want to use it, you'll need to build it yourself (sorry). Apart from the requirements listed below, keep in mind that this project has been only tested on Pop!_OS 22.04 LTS, using a GeForce RTX™ 3050, and driver version 580.82.09.
Which means, your system must support:
- VK_KHR_synchronization2
- VK_KHR_dynamic_rendering
- OpenGL 4.5: Direct Access Memory, Clip Control, and other features have been used.
You can check whether or not your graphics card supports these features here.
Building this project requires the following:
You may need to set these environment variables if they aren't automatically detected:
- Vulkan:
Set
VULKAN_SDKto point to your Vulkan SDK installation (e.g., C:/Vulkan/).
If the SDK fails to include it automatically, you must provide an environment variable named VULKAN_SDK under VulkanSDK/<version>.
-
Clone the repository
git clone --recurse-submodules https://github.com/dat-alpaca/turnip-engine
In case you forget the
--recurse-submodulesoption, just rungit submodule update --init --recursive. -
Generate the project
cmake -G Ninja -S . -B build/turnip -DCMAKE_POLICY_VERSION_MINIMUM=3.5Some other options can be set, such as:
Option Name Information Default -DTUR_BUILD_SANDBOX Builds the turnip sandbox program ON -DTUR_BUILD_ENGINE Builds the turnip engine library ON -DTUR_USE_GLFW* Uses the GLFW windowing implementation ON -DTUR_USE_OPENGL Uses the OpenGL backend ON -DTUR_USE_VULKAN Uses the Vulkan backend OFF * This option is a lie. Turnip doesn't support other platforms yet.
-
Compile the project Use the generated project files to build the project. This repository uses the
cmake --build build/turnip --parallel 12command officially.
However, if you're using a linux distribution, you can runmakedirectly. For Windows users, use theBuild Alloption upon opening the Visual Studio solution project, or runmsbuild.After that, you should have a working copy under
turnip-engine/build/turnip/.
The engine requires a location file specified as its main constructor argument. A default file can be located under res/engine_config.json.
Warning
Changing the graphics API string (windowingCapabilities/api) will not change the actual graphics API used.
As the TurnipRHI system uses static polymorphism, the engine has to be recompiled with the correct arguments.
Check the options listed here for more information.
Currently, there are no available examples nor documentation. The best you can do (which is highly discouraged) is to follow the turnip-sandbox project code source.
The engine does not provide a single entry point to the user, so you must declare an instance of the engine, and a conscrete implementation of a tur::View. However, the View is designed
to be as bare-bones as possible. It does not provide a renderer system nor scenes, albeit those are available to use.
With all being said, I would highly advise against using the engine for the moment. I will provide code examples and (probably) a proper documentation in the future.
This project is licensed under the MPL-2.0 license - see the LICENSE file for details. It is important to note that until a certain commit, the project was licensed under the MIT License.