All Projects → michal-z → zig-gamedev

michal-z / zig-gamedev

Licence: MIT license
Building game development ecosystem for @ziglang!

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
Zig
133 projects

Projects that are alternatives of or similar to zig-gamedev

Diligentengine
A modern cross-platform low-level graphics library and rendering framework
Stars: ✭ 2,142 (+102.27%)
Mutual labels:  vulkan, d3d12, raytracing, directx12
Wickedengine
3D engine focusing on modern rendering techniques and performance.
Stars: ✭ 3,148 (+197.26%)
Mutual labels:  vulkan, raytracing, bullet-physics, directx12
Mango
mango fun framework
Stars: ✭ 343 (-67.61%)
Mutual labels:  math, vulkan, simd
awesome-rtx
Curated collection of projects leveraging NVIDIA RTX technology (OptiX, DXR, VKR)
Stars: ✭ 73 (-93.11%)
Mutual labels:  vulkan, d3d12, raytracing
Diligentcore
Core functionality of Diligent Engine
Stars: ✭ 263 (-75.17%)
Mutual labels:  vulkan, d3d12, raytracing
Flycube
Graphics API wrapper is written in C++ on top of Directx 12 and Vulkan. Provides main features including ray tracing.
Stars: ✭ 78 (-92.63%)
Mutual labels:  vulkan, d3d12, raytracing
Bgfx
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Stars: ✭ 10,252 (+868.08%)
Mutual labels:  vulkan, d3d12, webgpu
glm
OpenGL Mathematics (GLM)
Stars: ✭ 6,667 (+529.56%)
Mutual labels:  vulkan, simd
Rtm
Realtime Math
Stars: ✭ 373 (-64.78%)
Mutual labels:  math, simd
Thermite
Thermite SIMD: Melt your CPU
Stars: ✭ 141 (-86.69%)
Mutual labels:  math, simd
Ugm
Ubpa Graphics Mathematics
Stars: ✭ 178 (-83.19%)
Mutual labels:  math, simd
Lift
Vulkan Path Tracer with Optix Denoiser integration
Stars: ✭ 30 (-97.17%)
Mutual labels:  vulkan, raytracing
HLML
Auto-generated maths library for C and C++ based on HLSL/Cg
Stars: ✭ 23 (-97.83%)
Mutual labels:  math, simd
hlml
vectorized high-level math library
Stars: ✭ 42 (-96.03%)
Mutual labels:  math, simd
Cglm
📽 Highly Optimized Graphics Math (glm) for C
Stars: ✭ 887 (-16.24%)
Mutual labels:  math, simd
Rust Game Development Frameworks
List of curated frameworks by the **Game Development in Rust** community.
Stars: ✭ 81 (-92.35%)
Mutual labels:  libraries, vulkan
RASM
3D Ray-Tracing WebGPU Game Engine Written in Rust WebAssembly.
Stars: ✭ 20 (-98.11%)
Mutual labels:  raytracing, webgpu
SCNMathExtensions
Math extensions for SCNVector3, SCNQuaternion, SCNMatrix4
Stars: ✭ 32 (-96.98%)
Mutual labels:  math, simd
rend3
Easy to use, customizable, efficient 3D renderer library built on wgpu.
Stars: ✭ 546 (-48.44%)
Mutual labels:  vulkan, d3d12
CrossWindow-Demos
🥪 Examples of how to use CrossWindow for things like rendering graphics, listening to events, etc.
Stars: ✭ 48 (-95.47%)
Mutual labels:  vulkan, directx12

Project requires Zig 0.10.0-dev.3027 (master) or newer to compile.

zig-gamedev project

This repository contains a collection of sample applications and cross-platform, composable libraries written in Zig programming language. Currently, it provides a solution for: 3D graphics, multi-threaded physics, SIMD math, audio, GUI, noise generation and profiling.

The goal of the project is to build a toolbox of libraries for Zig game developers. A lot of effort is being put to make the whole package consistent and let the developer use only the components she needs. Project is being developed by contributors and by one full-time developer.

If you are interested, please see Monthly Progress Reports and our Roadmap.

To get started on Windows/Linux/Mac try out physically based rendering (wgpu) sample:

(git with Git LFS extension and Zig 0.10.0-dev.3027 (master) or newer is required)

git clone https://github.com/michal-z/zig-gamedev.git
cd zig-gamedev
zig build physically_based_rendering_wgpu-run

Cross-platfrom (Win/Lin/Mac) libraries:

Windows libraries:

  • zwin32 - Zig bindings for Win32 API
  • zd3d12 - helper library for working with DirectX 12
  • zxaudio2 - helper library for working with XAudio2
  • zpix - support for GPU profiling with PIX
  • Interop with Direct2D and DirectWrite for high-quality vector graphics and text rendering (optional)

Project vision:

  • Works on Windows, Linux and macOS
  • Has zero dependency except Zig compiler (master), git with Git LFS and curl - no Visual Studio, Build Tools, Windows SDK, gcc, dev packages, system headers/libs, cmake, ninja, etc. is needed
  • Building is as easy as running zig build (see: Building)
  • Libraries are written from scratch in Zig or provide Ziggified bindings to carefully selected C/C++ libraries
  • Uses native version of wgpu API (mach/gpu-dawn) for cross-platfrom graphics and DirectX 12 for low-level graphics on Windows

I work on this project full-time and try to make a living from donations. If you like it, please consider supporting me. Thanks!

Cross-platfrom (Win/Lin/Mac) sample applications (native wgpu)

Some of the sample applications are listed below. More can be found in samples directory.

  1. physically based rendering (wgpu): This sample implements physically-based rendering (PBR) and image-based lighting (IBL) to achive realistic looking rendering results.

    physically based rendering (wgpu)

    zig build physically_based_rendering_wgpu-run

  2. audio experiments (wgpu): This sample lets the user to experiment with audio and observe data that feeds the hardware!

    audio experiments (wgpu)

    zig build audio_experiments_wgpu-run

  3. bullet physics test (wgpu): This sample application demonstrates how to use full 3D physics engine in your Zig programs.

    bullet physics test (wgpu)

    zig build bullet_physics_test_wgpu-run

  4. procedural mesh (wgpu): This sample shows how to efficiently draw several procedurally generated meshes.

    procedural mesh wgpu (wgpu)

    zig build procedural_mesh_wgpu-run

Windows sample applications (DirectX 12)

If you are new to DirectX 12 graphics programming I recommend starting with intro applications.

  1. rasterization: This sample application shows how GPU rasterizes triangles in slow motion.

    rasterization

    zig build rasterization-run

  2. simple raytracer: This sample implements basic hybrid renderer. It uses rasterization to resolve primary rays and raytracing (DXR) for shadow rays.

    simple raytracer

    zig build simple_raytracer-run

  3. mesh shader test: This sample shows how to use DirectX 12 Mesh Shader.

    mesh shader test

    zig build mesh_shader_test-run

Building sample applications

To build all sample applications (assuming zig is in the PATH and Git LFS is installed):

  1. git clone https://github.com/michal-z/zig-gamedev.git
  2. cd zig-gamedev
  3. zig build

Build artifacts will show up in zig-out/bin folder.

zig build <sample_name> will build sample application named <sample_name>.

zig build <sample_name>-run will build and run sample application named <sample_name>.

To list all available sample names run zig build --help and navigate to Steps section.

Build options

All sample applications support the following build options:

  • -Drelease-safe=[bool] - Optimizations on and safety on
  • -Drelease-fast=[bool] - Optimizations on and safety off
  • -Dztracy-enable=[bool] - Tracy profiler zones enabled
  • -Dzgpu-dawn-from-source=[bool] - Build Dawn (wgpu implementation) from source

Addidtional options for Windows applications:

  • -Denable-dx-debug=[bool] - Direct3D 12, Direct2D, DXGI debug layers enabled
  • -Denable-dx-gpu-debug=[bool] - Direct3D 12 GPU-Based Validation enabled (requires -Denable-dx-debug=true)
  • -Dzpix-enable=[bool] - PIX markers and events enabled

GitHub Sponsors

Thanks to all people who sponsor zig-gamedev project! In particular, these fine folks sponsor zig-gamedev for $25/month or more:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].