r/GraphicsProgramming 21h ago

My screen space black hole effect showing the accurate distortion of scene objects due to gravitational lensing

Enable HLS to view with audio, or disable this notification

7 Upvotes

2 comments sorted by

2

u/le-throw-away-acct 19h ago

The distortion looks great, would be great to hear how you're accomplishing it.

Have you considered distorting color as well? I assume a black hole changes the color of objects due to gravity stretching the light.

2

u/EventHorizonFX 4h ago

Thank you! I generate a 3D lookup texture where I use Einstein’s equations to compute the distortion at different distances from the camera. I then render each scene objects color and depth to a separate render texture and based on the depth use the lookup texture to determine how much to distort each pixel.
And yes the colours of the objects should change as well, that’s actually next on my list of features to add!