Ray tracing in GR

Following on from this post, a natural generalization is that to non-Euclidean spaces. This is important for simulating gravity, for example rendering a scientifically accurate trip through a wormhole (something I have long wanted to do but never got to work). The main difference is that ones rays are curved in general, which makes the equations much more difficult (really they need to be numerically integrated, making it orders of magnitude slower than normal ray-tracing). One complication of this is that generally the rays will also curve between the eye point and the screen. But the rays between your screen and your eye in real life do not curve, so it would look wrong!

I think the way out of this is to make the virtual screen very small and close to the eye. This doesn't affect the rendering in flat space (since only the directions of the rays matter) and effectively eliminates the need to take into account curvature between the screen and the eye (essentially it makes the observer into a locally Euclidean reference frame).

Another complications of simulated relativity is the inability to simulate time dilation. Well, you can simulate it perfectly well if you're the only observer in the simulated universe but this would be a big problem for anyone who wanted to make a relativistically-accurate multiplayer game - as soon as the players are moving fast enough with respect to each other to have different reference frames, they will disagree about their expected relative time dilations.

2 Responses to “Ray tracing in GR”

  1. Regarding time dilation in multiplayer, I think I can help a little; if you're moving at 7% the speed of light, then you will still be observing the game at full speed, but your character or ship or whatever will just do everything more slowly, with shifted electromagnetic emissions as well.

    • Extending on this concept, you could also perhaps break things up into instances. Even in a multiplayer game, if you're the only player in a particular section of the universe, it's no different than singleplayer, and for games (science fiction especially), there are always acceptable breaks from reality. If you wanted to make an MMO, you could simulate relativity accurately excluding time dilation, and just make up some BS about a technology that counteracts time dilation.

Leave a Reply