{"id":26848044,"url":"https://github.com/cyprus327/psim-compute","last_synced_at":"2025-03-30T20:38:38.935Z","repository":{"id":272485089,"uuid":"916358749","full_name":"cyprus327/psim-compute","owner":"cyprus327","description":"CPU/GPU particle sim using raylib and rlgl","archived":false,"fork":false,"pushed_at":"2025-01-31T22:30:34.000Z","size":1736,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T23:25:03.244Z","etag":null,"topics":["c","compute-shader","glsl","odin","particles","raylib","raylib-odin","rlgl"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyprus327.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-01-14T00:03:06.000Z","updated_at":"2025-01-31T22:30:37.000Z","dependencies_parsed_at":"2025-01-20T23:20:23.454Z","dependency_job_id":null,"html_url":"https://github.com/cyprus327/psim-compute","commit_stats":null,"previous_names":["cyprus327/psim-cpu","cyprus327/psim-compute"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyprus327%2Fpsim-compute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyprus327%2Fpsim-compute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyprus327%2Fpsim-compute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyprus327%2Fpsim-compute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyprus327","download_url":"https://codeload.github.com/cyprus327/psim-compute/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246379379,"owners_count":20767694,"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":["c","compute-shader","glsl","odin","particles","raylib","raylib-odin","rlgl"],"created_at":"2025-03-30T20:38:38.352Z","updated_at":"2025-03-30T20:38:38.927Z","avatar_url":"https://github.com/cyprus327.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CPU/GPU Particle Sims\n\nSimple particle simulation where the particles are all attracted to one point and don't interact with one another.\n\nThe CPU simulation is written in Odin using raylib for rendering, and the GPU simulation is written in C and GLSL, using a compute shader for particle calculations and raylib/rlgl for rendering.\n\n## Usage:\n**CPU Sim**:\n- Install [Odin](https://odin-lang.org/docs/install/), if not already installed\n- Clone this repo\n- Run `odin run cpu`\n\n**GPU Sim**:\nNOTE: The is in C instead of Odin because I had to recompile raylib's source to be able to use GLSL version 430, and Odin has raylib as part of it's vendor library so instead of going down the rabbit hole of how to recompile that I just wrote it in C. \n- Install Git, GCC, Make, and CMake, and ensure sure your computer supports OpenGL 4.3 or higher\n- Clone raylib, `git clone https://github.com/raysan5/raylib`\n- `cd raylib` and edit CMakeLists.txt, adding  to the start of the file `set(GRAPHICS=GRAPHICS_API_OPENGL_43)`\n- Recompile raylib with the edited CMakeLists.txt (e.g. `mkdir build \u0026\u0026 cd build \u0026\u0026 cmake .. \u0026\u0026 make \u0026\u0026 sudo make install`)\n  - If not installed already [this](https://github.com/raysan5/raylib?tab=readme-ov-file#installing-and-building-raylib-on-multiple-platforms) tutorial details how to install raylib on any platform\n- Compile and run following the tutorial mentioned above\n\n## GPU Screenshots with 2^23 (~8,000,000) particles\nthe screenshots don't do it justice, it looks much better moving but I can't screen record on this laptop\n\n![gpsim4](https://github.com/user-attachments/assets/9b8437eb-4f43-4509-bd1f-0f6374069b7d)\n![gpsim6](https://github.com/user-attachments/assets/97a04cde-39f0-4616-9e6a-50351da72f5b)\n![gpsim3](https://github.com/user-attachments/assets/2733e8c2-006f-4130-b933-e12ed34b1ca1)\n![gpsim7](https://github.com/user-attachments/assets/ed47ae73-1756-44bf-b594-c7a8e1a4ca63)\n![gpsim5](https://github.com/user-attachments/assets/eddee575-dbda-4b8e-8037-15c871fd88bf)\n\n## CPU Screenshots with 200,000 particles\n~50 FPS on my old laptop\n\n![psim1](https://github.com/user-attachments/assets/52be0d02-2882-4f1c-94fd-c0b9743acba4)\n![psim7](https://github.com/user-attachments/assets/0c454b6f-f71c-459a-ba4e-c84846502d2b)\n![psim2](https://github.com/user-attachments/assets/2c90925c-9a64-49fa-90ab-944ea962f1ea)\n![psim3](https://github.com/user-attachments/assets/2bf7da85-1fd9-42b5-8934-f6de48d599b2)\n![psim4](https://github.com/user-attachments/assets/b1478316-fba3-435a-8dd5-9692ebc44799)\n![psim5](https://github.com/user-attachments/assets/36e16ec5-387e-4256-912b-26c29f09f896)\n![psim6](https://github.com/user-attachments/assets/f9dad711-cb53-4fe0-8317-4c55c35f4b47)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyprus327%2Fpsim-compute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyprus327%2Fpsim-compute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyprus327%2Fpsim-compute/lists"}