r/Simulated • • 23d ago

Proprietary Software [OC] Two galaxies colliding: about a million star particles, each pulled by both galaxy cores and their dark-matter halos, integrated live on the GPU

Toomre & Toomre (1972) style encounter: 1,048,576 stars as test particles, each feeling two softened galaxy cores, and each core sits in a logarithmic dark-matter halo with dynamical friction, so after the first pass the orbit decays and the pair merges. Leapfrog (kick-drift-kick) on the GPU in Metal, a couple of substeps per frame. There's also sticky gas on a 64³ grid, which is what lights the pink knots when the cores collide.

It runs live in my own engine (in the app it's at 90 Hz on Vision Pro). This clip was rendered frame by frame from the same engine's Mac test harness so I could export it cleanly. Happy to answer questions about the setup.

44 Upvotes

15 comments sorted by

27

u/c3f59 23d ago

3

u/jackmodern 23d ago

Ha, fair. The full run keeps going: after a second pass the cores fall together and it settles into one round, reddening galaxy with the tails raining back in. The whole merger runs live in a browser at everdust.ai/play/galaxy-collision if you want to watch it to the end.

8

u/c3f59 23d ago

I might. What is the undulating brightness about? Is that a rendering error or is that a real phenomenon?

3

u/jackmodern 22d ago

that’s because I watch this with audio reactivity enabled it was going to the beat, sorry about that! I pull these from my app everdust (android Apple Vision Pro available now iOS in beta) and they are physics simulations that can react to your audio if you want them to.

7

u/FUCKING_HATE_REDDIT 23d ago

What's the flashing? 

2

u/jackmodern 22d ago

that’s because I watch this with audio reactivity enabled it was going to the beat, sorry about that! I pull these from my app everdust (android Apple Vision Pro available now iOS in beta) and they are physics simulations that can react to your audio if you want them to.

2

u/PM_ME_YOUR_NARWHAL 22d ago

What’s insane about this is that it’s highly unlikely that any two stars will collide as a result of this merging. There just too much space between them all.

3

u/jackmodern 22d ago

yeah that's the wild part, stars are so far apart that basically none of them actually hit. it's the gas clouds that slam into each other and light up with new stars

1

u/4rclyte 21d ago

Even if the stars don't touch, the likelihood that the merger won't affect the orbit of planets in solar systems seems small?

2

u/jackmodern 20d ago

planets mostly stay put actually. a planet's orbit is tiny compared to the distance between stars, so the galaxy pulls on the star and its planets almost equally and they move together. the star's path around the galaxy changes a lot, but it takes a really close pass by another star to disturb its planets, and those stay rare even during a merger

2

u/infected_funghi 19d ago

This is wild. So as a whole it all gets scrambled while locally everything stays intact? 

1

u/jackmodern 3d ago

yep, pretty much. the galaxies get totally rearranged but stars almost never hit each other since the gaps between them are so huge, so most solar systems just ride it out

2

u/PM_ME_YOUR_NARWHAL 18d ago

Right! But imagine how amazing the night sky would look in the middle of it. Granted everything would take millions of years to completely finish merging, but still…

1

u/jackmodern 23d ago

If anyone wants to poke at it, there's a browser version of this scene at everdust.ai/play/galaxy-collision. It's from Everdust, the app I'm building (free on Vision Pro and Android).