Zig: Game Framework > Zig-Gamedev Project
Sample apps and libraries using DirectX 12.
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.
Getting Started
- Download and install Git LFS
- Download and install anyzig (recommended) or get a compatible Zig compiler by some other means.
- Clone this repo
git clone git@github.com:zig-gamedev/zig-gamedev.git && cd zig-gamedev
Build and run a sample app:
zig build physically_based_rendering_wgpu-run
Get a list of all available build steps for the native target:
zig build -l
Get a list of all available build steps for web (using emscripten):
zig build -l -Dtarget=wasm32-emscripten
Sample applications (native wgpu)
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-runaudio experiments (wgpu): This sample lets the user experiment with audio and observe data that feeds the hardware.
zig build audio_experiments_wgpu-runbullet physics test (wgpu): This sample application demonstrates how to use full 3D physics engine in your Zig programs.
zig build bullet_physics_test_wgpu-runprocedural mesh (wgpu): This sample shows how to efficiently draw several procedurally generated meshes.
zig build procedural_mesh_wgpu-rungui test (wgpu): This sample shows how to use our zgui library.
zig build gui_test_wgpu-run
Sample applications (DirectX 12)
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-runrasterization: This sample application shows how GPU rasterizes triangles in slow motion.
zig build rasterization-runsimple raytracer: This sample implements basic hybrid renderer. It uses rasterization to resolve primary rays and raytracing (DXR) for shadow rays.
zig build simple_raytracer-runmesh shader test: This sample shows how to use DirectX 12 Mesh Shader.
zig build mesh_shader_test-run