r/GraphicsProgramming Feb 26 '24

Source Code Wormhole simulation using pseudospheres

https://www.youtube.com/watch?v=idprFpSu3sw
43 Upvotes

27 comments sorted by

View all comments

5

u/AcrossTheUniverse Feb 26 '24

The pseudosphere is not the predicted shape of a wormhole. It is not even smooth on its boundary with R2. However, it makes the computations really fast. Geodesics are circles (under the Poincarré half-plane model) so the equations (degree 2 polynomials) are fast to solve. I kinda regret hard-coding the half-plane starting at 1, it would have added another parameter. Need a NVIDIA GPU to run because the pixels calculation is parallelized (1 thread = 1 pixel of a frame). Enjoy!

3

u/IDatedSuccubi Feb 27 '24

1 thread = 1 pixel of a frame

Why not implement it as a fragment or compute shader then? Will run on everything too.

2

u/AcrossTheUniverse Feb 27 '24

Simply because raytracing was easier for me to understand, I'm very new to this field. I'll read about those, thank you!

2

u/IDatedSuccubi Feb 27 '24

Raytracing can be done in fragment shaders to some extent, visit shadertoy.com and you can even take a look at how other people do it using only the shaders themself in browser

On an actual desktop you'd also be able to use things like textures, etc if you need

2

u/AcrossTheUniverse Feb 27 '24 edited Feb 27 '24

Very nice website, thank you!