zig-gamedev dev repo
The original repo spawned in July 2021 by Michal Ziulek. This is the main development repo for the zig-gamedev libraries and sample applications.
Zig is still in development. Our main branch aims to track zig nightly-ish. See .zigversion for the last known compatible Zig version for any revision.
Libraries now live in their own repositories and are consumed using Zig's package manager. Git submodules are also included in this repo for developer convenience but are not required to build. Users that wish to use the submodules instead of remote packages can replace build.zig.zon with dev.build.zig.zon.
Build and run the Samples
To get started on Windows/Linux/macOS try out physically based rendering (wgpu) sample:
zig build physically_based_rendering_wgpu-run
To get a list of all available build steps:
zig build -l
Some of the sample applications are listed below. More can be found in samples directory.
-
physically based rendering (wgpu): This sample implements physically-based rendering (PBR) and image-based lighting (IBL) to achive realistic looking rendering results.
zig build physically_based_rendering_wgpu-run
-
audio experiments (wgpu): This sample lets the user experiment with audio and observe data that feeds the hardware.
zig build audio_experiments_wgpu-run
-
bullet physics test (wgpu): This sample application demonstrates how to use full 3D physics engine in your Zig programs.
zig build bullet_physics_test_wgpu-run
-
procedural mesh (wgpu): This sample shows how to efficiently draw several procedurally generated meshes.
zig build procedural_mesh_wgpu-run
-
gui test (wgpu): This sample shows how to use our zgui library.
zig build gui_test_wgpu-run
Some of the sample applications are listed below. More can be found in samples directory. They can be built and run on Windows and Linux (Wine + VKD3D-Proton 2.8+):
-
bindless: This sample implements physically based shading and image based lighting to achieve realistic looking rendering results. It uses bindless textures and HLSL 6.6 dynamic resources.
zig build bindless-run
-
rasterization: This sample application shows how GPU rasterizes triangles in slow motion.
zig build rasterization-run
-
simple raytracer: This sample implements basic hybrid renderer. It uses rasterization to resolve primary rays and raytracing (DXR) for shadow rays.
zig build simple_raytracer-run
-
mesh shader test: This sample shows how to use DirectX 12 Mesh Shader.
zig build mesh_shader_test-run