{"id":31974460,"url":"https://github.com/acrane77/particlesimulation","last_synced_at":"2026-05-14T20:06:01.140Z","repository":{"id":313972813,"uuid":"1053652121","full_name":"acrane77/ParticleSimulation","owner":"acrane77","description":"A real time particle system written in C++ with OpenGL, featuring multiple emission patterns, dynamic winds, rendered as smooth, feathered point sprites with custom GLSL shaders.","archived":false,"fork":false,"pushed_at":"2025-09-25T14:21:31.000Z","size":796,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-25T16:27:37.973Z","etag":null,"topics":["cpp","english","opengl","particles","physics","physics-simulation","simulation"],"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/acrane77.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-09T18:34:26.000Z","updated_at":"2025-09-25T14:21:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc0a6532-8450-45a7-b59a-17174648414c","html_url":"https://github.com/acrane77/ParticleSimulation","commit_stats":null,"previous_names":["acrane77/particlesimulation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/acrane77/ParticleSimulation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acrane77%2FParticleSimulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acrane77%2FParticleSimulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acrane77%2FParticleSimulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acrane77%2FParticleSimulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acrane77","download_url":"https://codeload.github.com/acrane77/ParticleSimulation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acrane77%2FParticleSimulation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279021014,"owners_count":26086947,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cpp","english","opengl","particles","physics","physics-simulation","simulation"],"created_at":"2025-10-14T20:17:04.000Z","updated_at":"2026-05-14T20:06:01.121Z","avatar_url":"https://github.com/acrane77.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenGL Particle System\n\nReal-time particle system in C++ using OpenGL 4.6, GLFW, GLAD, and GLM.\nSupports multiple emission patterns and particle types, including smoke, sparks, fireworks, rain, and snow. Particles are rendered as smooth, circular, feathered sprites via custom GLSL shaders.\n\n![Alt Text](https://media0.giphy.com/media/v1.Y2lkPTc5MGI3NjExc3k4aXBsZzBnMmJtcXJ6OTBjc2pqOTFrcHNobTNuamt1MjFocDk5dyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/ABRmLAPr5BExNPFOcG/giphy.gif)\n\n---\n\n## Project Structure  \n├── deps/                 | External dependencies (GLFW, GLAD, GLM, etc.)  \n├── shaders/              |  Custom shaders  \n│   ├── points.vert       | Vertex shader (transform + size)  \n│   └── points.frag       | Fragment shader (circular sprite with smooth edges)  \n├── particle_main.cpp     | Simulation + rendering loop  \n├── particle_main.hpp     | Header file with struct definitions\n└── README.md             | This file  \n\n---\n\n## Features\n- Scalable particle core\n- Efficient circular buffer with capacity for 50,000 particles.\n- Stable iteration helpers to update and draw only alive particles.\n- Emission patterns like Plume, Random, Rising, Falling, Circle.\n\n### Particle types \u0026 behaviors\n\n- Smoke: buoyant, expands, fades; wind-responsive drift.\n- Sparks: bright, flicker/decay, drag; additive blending.\n- Firework: launches with a fuse, emits smoke trail, explodes into a radial spark burst.\n- Rain: fast falling streaks that die on ground contact.\n- Snow: slow, wind-wobbly flakes that settle and fade on the ground.\n\n### Wind \u0026 turbulence\n\n- Time-varying gust system (direction + strength targets with smooth interpolation).\n- Low-frequency band-wave turbulence for natural meander.\n\n### Rendering pipeline\n\n- Single VBO of packed DrawParticle { vec4 pos_size, vec4 colour }.\n- Type grouping each frame: alpha-blended pass for smoke/snow/rain, additive pass for sparks.\n- GLSL shaders produce circular, feathered point sprites with per-particle color/alpha.\n\n### Interactive camera\n\nControls:\n- Right-drag: orbit\n- Middle-drag or Shift + Right-drag: pan\n- Scroll: zoom\n\n### Emitter placement\n- Left-click: place an emitter, with multiple emitters supported.\n\n## Keyboard shortcuts\n\n### Patterns:\n  - `1` Plume\n  - `2` Random\n  - `3` Rising\n  - `4` Falling\n  - `5` Circle\n\n### Types:\n  - `S` Smoke\n  - `F` Spark\n  - `W` Firework\n  - `R` Rain\n  - `N` Snow\n    \n### Global: \n  - `C` Clear all emitters\n\n## Shaders\n\n- Vertex (shaders/points.vert)\n  - Applies projection/view transform and writes per-vertex gl_PointSize from pos_size.w. Expects uniform uViewProj.\n\n- Fragment (shaders/points.frag)\n  - Computes a circular mask in point coordinates to create round, feathered sprites and tints by the provided colour.\n\n---\n\n## Getting Started\n\n### Prerequisites\n- C++17 or later\n- OpenGL 4.6 context (the code requests 4.6; most 4.5+ drivers work)\n- CMake (recommended) or your preferred build system\n\n### Dependencies:  \n- GLFW  \n – window \u0026 input  \n- GLAD  \n – OpenGL loader  \n- GLM  \n – OpenGL math  \n\n## Build \u0026 Run\nQuick compile (MinGW-w64 / Windows)\n\nFrom the project root:\n```\ng++ .\\particle_main.cpp .\\deps\\src\\glad.c ^  \n  -I .\\deps\\include ^  \n  -I C:\\msys64\\mingw64\\include ^  \n  -L C:\\msys64\\mingw64\\lib ^  \n  -lglfw3 -lopengl32 -lgdi32 -luser32 -lshell32 -lwinmm -o main.exe  \n```\nThen run:\n```\n./main\n```\nLinux \n```\ng++ particle_main.cpp deps/src/glad.c \\\n  -I deps/include \\\n  -lglfw -ldl -lX11 -lpthread -lXrandr -lXi -o main\n./main\n```\n\nmacOS (using system frameworks + Homebrew GLFW)\n```\nclang++ particle_main.cpp deps/src/glad.c \\\n  -I deps/include \\\n  -L /opt/homebrew/lib -lglfw \\\n  -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo \\\n  -std=c++17 -o main\n./main\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facrane77%2Fparticlesimulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facrane77%2Fparticlesimulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facrane77%2Fparticlesimulation/lists"}