{"id":28547906,"url":"https://github.com/lucascompython/particle-simulation-2d","last_synced_at":"2025-07-09T23:37:47.485Z","repository":{"id":294694392,"uuid":"974891142","full_name":"lucascompython/particle-simulation-2d","owner":"lucascompython","description":"2D Particle Simulation","archived":false,"fork":false,"pushed_at":"2025-05-21T18:29:58.000Z","size":102,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-10T01:08:04.096Z","etag":null,"topics":["dawn","imgui","sdl","webgpu","wgpu","zig"],"latest_commit_sha":null,"homepage":"https://particles-simulation-2d.netlify.app","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucascompython.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-29T13:11:34.000Z","updated_at":"2025-05-21T18:30:02.000Z","dependencies_parsed_at":"2025-05-21T16:45:03.648Z","dependency_job_id":"df0e89e4-7b1d-4bca-9d5e-4ced2b586613","html_url":"https://github.com/lucascompython/particle-simulation-2d","commit_stats":null,"previous_names":["lucascompython/particle-simulation-2d"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lucascompython/particle-simulation-2d","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascompython%2Fparticle-simulation-2d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascompython%2Fparticle-simulation-2d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascompython%2Fparticle-simulation-2d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascompython%2Fparticle-simulation-2d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucascompython","download_url":"https://codeload.github.com/lucascompython/particle-simulation-2d/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascompython%2Fparticle-simulation-2d/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264505356,"owners_count":23618928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dawn","imgui","sdl","webgpu","wgpu","zig"],"created_at":"2025-06-10T01:08:07.192Z","updated_at":"2025-07-09T23:37:47.480Z","avatar_url":"https://github.com/lucascompython.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 2D Particle Simulation\nThis project is built with [`Zig`](https://ziglang.org/), [`SDL3`](https://github.com/libsdl-org/SDL), [`Dawn`](https://github.com/google/dawn) / [`Wgpu-Native`](https://github.com/gfx-rs/wgpu-native) and [`ImGui`](https://github.com/ocornut/imgui).\n\nThis project is a rewrite of [this project](https://github.com/lucascompython/particles) that used Raylib and performed all the calculations on the CPU.\n\nI'm making this project with the goal of learning modern graphics programming and the differences between graphics library stacks.\n\nA 3D version of this simulation that uses [`Rust`](https://www.rust-lang.org/) + [`Winit`](https://github.com/rust-windowing/winit) + [`Wgpu`](https://github.com/gfx-rs/wgpu) + [`Egui`](https://github.com/emilk/egui), can be found [here](https://github.com/lucascompython/particle-simulation-3d).\n\n## Demo\nhttps://github.com/user-attachments/assets/5b5efdc1-bf9a-4533-bed4-976d08e197d7\n\n\n\n## Simulation Methods\nThe simulation can run on different methods, such as:\n- CPU - Works everywhere but has limited performance\n- GPU (Compute Shaders) - Only works on native and WebGPU (no WebGL support) but has much better performance\n\nI wanted to add another GPU method, namely Transform Feedback since it is (I think) pretty the most performant method for this simulation that can run on WebGL, but I've found it difficult to implement in `wgpu`. Here is a [discussion](https://github.com/gfx-rs/wgpu/discussions/7601) about it. Still looking into it!\n\n## Build Locally\n\nThis project has the following build dependencies:\n- **zig** - for, well, the program itself\n- **python3** - for [`dear_bindings`](https://github.com/dearimgui/dear_bindings) and [`fetching the dependencies of Dawn`](https://github.com/google/dawn/blob/main/tools/fetch_dawn_dependencies.py)\n- **git** - for downloading the [submodules](/external)\n- **rust** - for compiling `wgpu-native`\n- **clang** - for compiling `C`/`C++` code with `LTO` enabled and not conflict with the `Zig`/`Rust` compilers\n- **cmake** - for compiling `SDL3` and `Dawn`\n- **ninja** - for compiling `SDL3` and `Dawn`\n- And development packages of multiple things like OpenGL, X11, Wayland, libc++, etc.\n\n```bash\ngit clone https://github.com/lucascompython/particle-simulation-2d.git\ncd particle-simulation-2d\n\nzig build make-deps # Will fetch the submodules and build the dependencies (SDL3, ImGui, Dawn, Wgpu-Native)\n\nzig build run\n# OR\nzig build run -Doptimize=ReleaseFast # for release build\n```\n\n## TODO:\n- Add Web support\n- Improve performance\n- Add mobile support\n- Make CI work nicely\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucascompython%2Fparticle-simulation-2d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucascompython%2Fparticle-simulation-2d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucascompython%2Fparticle-simulation-2d/lists"}