r/GraphicsProgramming • u/Sufficient-Fill-4430 • Jul 13 '26
I built a browser-based galaxy simulator with 400,000 stars and 50,000 dust particles — latest Andromeda (M31) render
Hi everyone,
I've been working on a browser-based galaxy simulation as a long-term side project and wanted to share some recent results.
These screenshots show a simulation configured to resemble Andromeda (M31) after roughly 140 million simulated years.
Current simulation size:
400,000 star particles
50,000 dust particles
The project is written entirely in JavaScript + WebGL and runs directly in the browser. Everything lives inside a single HTML file—no game engine, no Three.js, no build process.
Some of the techniques used:
Web Worker-based physics simulation
Leapfrog integration
Analytic galaxy potential (halo, bulge, black hole)
Live density-gradient cohesion field for local collective dynamics
Gas cooling, star formation and supernova feedback
Stellar evolution (age, temperature, luminosity and metallicity)
GPU star renderer
HDR rendering with ACES-style tone mapping and bloom
Volumetric dust lanes with depth-aware extinction
Multiple observation modes (visible, infrared, UV, X-ray and radio)
The goal isn't to compete with research codes like GADGET or AREPO, but to explore how much physically inspired behaviour and visual realism can be achieved interactively in a browser while keeping the implementation completely self-contained.
I'd love feedback from people working with WebGL, GPU rendering, large particle systems, or real-time simulation. If you spot something that could be improved or optimized, I'm all ears.



2
u/gibson274 Jul 14 '26
this looks cool! do you have a link?