{"id":51445123,"url":"https://github.com/torifo/starforge-webgpu","last_synced_at":"2026-07-05T15:30:39.680Z","repository":{"id":367333040,"uuid":"1276226416","full_name":"torifo/starforge-webgpu","owner":"torifo","description":"数千体のN体重力シミュをWebGPUコンピュートシェーダで動かすシネマティックな物理サンドボックス作品集 (WebGPU)","archived":false,"fork":false,"pushed_at":"2026-06-25T14:43:09.000Z","size":392,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-25T15:33:05.839Z","etag":null,"topics":["compute-shader","github-pages","gpu","javascript","n-body","physics","simulation","visualization","webgpu","wgsl"],"latest_commit_sha":null,"homepage":"https://torifo.github.io/starforge-webgpu/","language":"JavaScript","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/torifo.png","metadata":{"files":{"readme":"README.en.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":"2026-06-21T17:46:16.000Z","updated_at":"2026-06-25T14:43:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/torifo/starforge-webgpu","commit_stats":null,"previous_names":["torifo/starforge-webgpu"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/torifo/starforge-webgpu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torifo%2Fstarforge-webgpu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torifo%2Fstarforge-webgpu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torifo%2Fstarforge-webgpu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torifo%2Fstarforge-webgpu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/torifo","download_url":"https://codeload.github.com/torifo/starforge-webgpu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torifo%2Fstarforge-webgpu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35160046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-05T02:00:06.290Z","response_time":100,"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":["compute-shader","github-pages","gpu","javascript","n-body","physics","simulation","visualization","webgpu","wgsl"],"created_at":"2026-07-05T15:30:39.435Z","updated_at":"2026-07-05T15:30:39.663Z","avatar_url":"https://github.com/torifo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[日本語](./README.md) ・ [**English**](./README.en.md)\n\n# WebGPU N-Body Gravity Sandbox (starforge-webgpu)\n\n\u003c!-- tech-stack:start (auto-generated) --\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/WebGPU-005A9C?style=for-the-badge\u0026logo=webgpu\u0026logoColor=white\" alt=\"WebGPU\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge\u0026logo=javascript\u0026logoColor=black\" alt=\"JavaScript\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/HTML5-E34F26?style=for-the-badge\u0026logo=html5\u0026logoColor=white\" alt=\"HTML5\"\u003e\n\u003c/p\u003e\n\u003c!-- tech-stack:end --\u003e\n\nA cinematic physics-sandbox gallery that runs an **N-body gravity simulation** of thousands of bodies\non the GPU via compute shaders. Click a curated scene in the **gallery** to launch it **full-screen**,\nthen grab and throw stars, drop heavy bodies, hurl clusters into collisions, and fast-forward time\n(hyperlapse) to watch the cosmos evolve. It's the \"real computation\" counterpart to\nCSS-animation studies. No backend, no network — plain ES modules.\n\n## Screenshots\n\n![Gallery (6 scenes)](docs/screenshots/gallery.jpg)\n\n| Galaxy collision (time controls, tools, and guide visible) | Accretion disk |\n|---|---|\n| ![Galaxy collision](docs/screenshots/galaxy-collision.jpg) | ![Accretion disk](docs/screenshots/accretion-disk.jpg) |\n\n## Flow\n**Gallery (6 scenes) → click for full-screen immersion → Esc to return.** The current scene is kept in the URL hash (`#scene=galaxy`).\n\n| Scene | Highlight |\n|---|---|\n| Solar system | stable orbits, Keplerian rhythm |\n| Galaxy collision | tidal tails, the big spectacle |\n| Accretion disk | inward spiral, glowing ring |\n| Collapse (birth) | diffuse gas → structure |\n| Gravity slingshot | intruder accelerates and scatters |\n| Globular cluster | many-body aggregation, the GPU's forte |\n\n## Look (cinematic effects)\n- **Bloom**: bright cores bleed light.\n- **Orbit trails**: a decaying history buffer leaves fading light trails.\n- **Nebula backdrop**: faint colored gas for depth.\n- HDR offscreen (rgba16float) → ACES tonemap composite.\n\n## Tools (four verbs)\nSwitch via the bottom toolbar or number keys `1`–`4`. Each tool's explanation shows in a collapsible **guide**.\n\n| Tool | Gesture | Effect |\n|---|---|---|\n| Grab / throw | drag to pull → release to throw | attracts bodies near the cursor; release imparts the cursor's momentum |\n| Place mass | drag (direction = velocity) | drops a heavy body that sweeps up its surroundings — seeds cores \u0026 accretion |\n| Collide | drag to launch | fires a small cluster of stars to set up a collision with an existing group |\n| Shock | click | a radial shockwave from the cursor that blasts compact structure apart |\n\nView: wheel zoom · right/Shift-drag pan · `R` reset · `Esc` gallery.\n\u003e All interactions run as GPU compute passes (`interact.wgsl`) — no CPU readback or picking.\n\n## Time control (forward-first)\n\"Speed\" is the number of physics **substeps per frame** (dt stays fixed, so integration never blows up).\n\n- `Space` pause/resume · `,` `.` slower/faster (0.25x–64x) · `h` **hyperlapse** (compress eons into seconds) · `n` single frame-step.\n- A body-count-aware **load guard** trims effective substeps and the HUD shows the effective rate (e.g. `64x (~8x)`).\n- An **epoch clock** (`T+ Myr/Gyr`) makes elapsed time visible.\n- `z` **rewinds** a little (state is auto-snapshotted every few seconds and right before each interaction — lightweight GPU-buffer checkpoints).\n\n## Stack\n- **Rendering**: WebGPU (compute pipeline for force integration, render pipeline for points) + WGSL\n- **Setup**: plain ES modules (no build step), zero dependencies, no CDN\n- **Fallback**: a clear message when WebGPU is unavailable (never a blank page)\n\n## Run \u0026 verify\nIn a WebGPU-capable browser (recent Chrome / Edge, etc.):\n```sh\npython3 -m http.server 8095   # → http://localhost:8095/\n```\n\n```sh\nfor f in src/shaders/*.wgsl; do naga \"$f\"; done   # validate WGSL\nfor f in src/*.js; do node --check \"$f\"; done       # JS syntax\nnode test/scenes.test.mjs                            # scene init conditions (78)\nnode test/bindings.test.mjs                          # binding contract (46)\n```\n\u003e The actual rendered visuals (orbits, bloom, trails) are confirmed visually in a WebGPU browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorifo%2Fstarforge-webgpu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorifo%2Fstarforge-webgpu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorifo%2Fstarforge-webgpu/lists"}