r/computergraphics 13d ago

realtime wormholes in browser

275 Upvotes

25 comments sorted by

7

u/SyntheticDuckFlavour 13d ago

Looks pretty cool. Is there a write-up on the technique?

11

u/olof_src 13d ago edited 12d ago

thanks. Its ray marching in curved space. So, with each step, the basis vectors are updated according to the "metric tensor". There are optimisations to get high accuracy in real time, with many wormholes and changing curvature controlled by sliders. There is information online.

3

u/diningeachox 13d ago

Is the idea that instead of a ray (and it's reflections) following a straight line in Euclidean space, it instead follows a geodesic w.r.t the metric and the draw call is on whichever pixel this geodesic happens to be projected to in screen space?

4

u/olof_src 13d ago edited 13d ago

Yes thats the idea! The start of the geodesic direction is caculated based on location in curved space and the rotation of camera etc. Then geodesic is traced outward. Then there are some tricks to speed it up and get better numerical precision.

1

u/3BlackFeathers 8d ago

Badass!!! thank you for sharing your process

2

u/SyntheticDuckFlavour 13d ago

Thanks for the info

3

u/Rhed0x 13d ago

Very cool shader but I feel like I'm getting a headache from watching you go through it.

3

u/CreativeChris1 13d ago

What the f, this melted my mind. Wild. So cool

2

u/Finniebelle 13d ago

This looks super amazing 😍 great work!

2

u/billydecay 12d ago

I didn't see any worms :(

2

u/3BlackFeathers 8d ago

Looks amazing!

1

u/Harha 13d ago edited 13d ago

What if you make the wormhole long, go inside the tunnel and try to go sideways towards the "wall"?

edit: I guess that doesn't make sense? There is no "wall"...

1

u/olof_src 13d ago

yea, thats like going around in a 4d straw. it will be like everything is just kindof shifting but u dont get in/out

1

u/yolcogot 12d ago

Supervbro

1

u/RockosModernBasiIisk 12d ago

Can you make it a game or put it in a game or something? Seems like a fairly novel idea, I think my son would like it if it was in a game or something. 

1

u/olof_src 12d ago

Thats the plan! Follow me here for updates ;).

1

u/RockosModernBasiIisk 12d ago

Hell yeah , would be such a cool way to traverse levels or whatever. 

1

u/Liquid_Audio 10d ago

Is it live somewhere?

1

u/olof_src 10d ago

not yet

2

u/sunapi386 10d ago

Super neat. Will there be github?

1

u/olof_src 10d ago

thx, yea when ive polished it a bit.

1

u/Gregrox 9d ago

would I be able to put my own custom skyboxes/sky-equirectangular-maps in? That would be really useful for me.

1

u/olof_src 8d ago edited 8d ago

Yes, ill share the github project later at some point!

1

u/ms_dizzy 10d ago

have you ever played split gate?
It's like this game.. no rail guns needed.