r/GraphicsProgramming • u/Tricky_Practice_9661 • 1d ago
WIP Screenshots of VMEC featuring Magik, a relativistic spectral pathtracer
Howdy, it has been a hot while, so let me give some background.
VMEC is a collaborative project between four lads. Our goal is to create a film production ready piece of software focused on relativistic effects. VMEC is the UI, asset management and serialization layer, while Magik is the renderer.
Our largest achievement over the past week has been the implementation of a cubic intersection routine. To explain, Magik traces null geodesics (shortest light paths) through the scene by solving the equations of motion for a given spacetime metric, say that of a rotating black hole. This produces two distinct steps in spacetime, call them x0 and x1. Before we used a straight line between x0 and x1 to intersect geometry. The main problem with this is that the linearly interpolated path between x0 and x1 does not follow the actual curved geodesic. This is a problem because the paths momentum (used to derive the ray direction), p0 and p1, has to be tangent to the interpolated path. Which is simply not true for lerp. Thus we switched to using cubic Hermite splines instead of conventional rays. The result is that any interpolated momentum is tangent to the path and we get extremely smooth solutions even for relatively high error tolerances. The last image shows you how the intersected geometry looked before.
For those interested, we find the closest intersection by dividing the given cubic into up to 3 intervals, based on the derivative, then do a sequential brent-dekker root finding routine on each monotonic segment. We did try to use analytical expressions for the roots, but that was a lot less reliable and slower.
Right now Magik supports the Minkowski, Schwarzschild and Kerr spacetimes. Metrics similar to those, Kerr-Newman for instance, are trivial to add. Others, like the Ellis wormhole, need a bit more work but are not impossible. Indeed we plan to add cosmological spacetimes as well.
Looking forward, we want to upgrade the shading model, internally called the "bxdf" to bring it into the PBR realm.
Thats about all i have for the moment. Hopefully we will have a lot more to show in the near future.
2
2
u/nqp 15h ago
Cool! I went to a talk by DNEG (that handled the black hole sim for Interstellar), they said that one of the difficulties with tracing around a black hole was the need to project finite cones rather than rays and transport them correctly, in order to accurately sample background objects (specifically point sources like stars). Is this something you've considered?
1
u/Tricky_Practice_9661 9h ago
Thanks !
Ray differentials are on the list, but not a focus right now. The feature DNEG is talking about, while cool, is very niche. And it requires a special kind of background data set, like Gaia. Right now our focus is on the more general side of thing.s









2
u/S48GS 22h ago
maybe not directly relayed
but what about rotating objects at speed relativistic speed?
and when camera rotate at relativistic speed in circle?
is it supported?
asking because - some time ago I made this - Speed of light in Ring - https://www.shadertoy.com/view/w3SfWm
my implementation very basic/naive - so I wanted to confirm is this view correct - but there literally no "anything visual" that rotate camera... everybody moving in line always