Sign in to follow this  

Raytracing + general relativity

This topic is 4815 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been learing about general realtivity in school the past couple of days, really cool stuff; the bending of light and black holes seem most interesting. Combining my interest in physics with programming i thought i could do some simulations related to the topic. So i was thinking of doing a ray traced version of a solar system or some other astronomical bodies (black holes anyone?). Ok, so how could the path of light be calculated taking into consideration gravitiational pull from massive stars? Well mostly how could i do calculate intersections in a space curved from these bodies? (if it's possible). I've done a simulation of the curvature of space using a grid of points and calculating at each point the total disturbance caused by all objects like this f(x, y) = sum( G * Mi / ((x - xi)^2 + (y - yi)^2)). The results are quite cool i'm thinking of adding forces and movement. We haven't gone into the any of the math involved in school, because we haven't done such advanced math (meh, have to wait for college) so i'm asking this question without much knowledge of the math involved (i saw some huge equations on a site about general realtivity but they were for arbirary objects, i'm guessing for spheres they should be simpler). Any pointers / links to these kind of things? hmm, maybe the math forum would be more appropiate, but everybody comes here..

Share this post


Link to post
Share on other sites
Nice idea. But, as i know, GR is pretty hard, alot harder than SR... i know SR and related math probably well enough to make a renderer, but not GR. Perhaps, for slowly moving masses, light equations is simple enough (just attraction and G Dopler), but i don't sure.


(SR=special relativity. GR=general relativity)

Share this post


Link to post
Share on other sites
The maths is very advanced. The basic idea is that space-time, a four dimensional space containing both space and time, is locally flat but on an astronomical scale it is curved, by masses such as planets and stars.

This is very difficult to represent as to do so you need a virtual fifth dimension in which the curvature takes place - virtual as it doesn't really exist but is just a mathematical construct meant to make things easier (!).

Once you have this motion takes place along geodesics in it, i.e. lines which are locally straight but curve to follow the curved 4D surface. The space is spacetime, in which every body has a 'velocity' (even bodies at rest are moving in time), so a path exists for each body, and the curvature accounts for e.g. how a body escapes or doesn't escape a gravitational field depending on its initial 4-position and 4-velocity in spacetime.

This is difficult to imagine but it's mathematically an order of magntude more complex. It was a hard third year course at my university which I avoided. But I don't think you'll need such math for a simulation: if you use the equation you quote, treating light as a particle travelling at light-speed that can be diverted but not slowed (instead experiencing a doppler effect escaping strong gavitational fields).

I don't know how close this is to the 'correct' GR maths but I suspect it will either be almost correct or out by a magnitude which you can correct for by comparing your simulation with real examples of e.g. gravitation lensing.

Share this post


Link to post
Share on other sites
Quote:
Original post by johnb

if you use the equation you quote, treating light as a particle travelling at light-speed that can be diverted but not slowed (instead experiencing a doppler effect escaping strong gavitational fields).

I don't know how close this is to the 'correct' GR maths but I suspect it will either be almost correct or out by a magnitude which you can correct for by comparing your simulation with real examples of e.g. gravitation lensing.


Sounds good, i was thinking along the same lines but this sort of raytracing would be step by step, like doing it in a voxel field.

My formula gives nice results for static masses, but does not allow gravitational waves from moving ones. Any ideas on how to do those? I'm imagining it like a fluid simulation where energy flows between grid points.

Share this post


Link to post
Share on other sites
Quote:
Original post by johnb
The maths is very advanced. The basic idea is that space-time, a four dimensional space containing both space and time, is locally flat but on an astronomical scale it is curved, by masses such as planets and stars.

This is very difficult to represent as to do so you need a virtual fifth dimension in which the curvature takes place - virtual as it doesn't really exist but is just a mathematical construct meant to make things easier (!).

Once you have this motion takes place along geodesics in it, i.e. lines which are locally straight but curve to follow the curved 4D surface. The space is spacetime, in which every body has a 'velocity' (even bodies at rest are moving in time), so a path exists for each body, and the curvature accounts for e.g. how a body escapes or doesn't escape a gravitational field depending on its initial 4-position and 4-velocity in spacetime.

This is difficult to imagine but it's mathematically an order of magntude more complex. It was a hard third year course at my university which I avoided. But I don't think you'll need such math for a simulation: if you use the equation you quote, treating light as a particle travelling at light-speed that can be diverted but not slowed (instead experiencing a doppler effect escaping strong gavitational fields).

I don't know how close this is to the 'correct' GR maths but I suspect it will either be almost correct or out by a magnitude which you can correct for by comparing your simulation with real examples of e.g. gravitation lensing.

I guess it's not close to GR math by at least magnitude of 2. GR result of light disturbance by sun gravitationfield is 2 times bigger than non-GR results, IIRC. It's one of ways how GR was proven, IIRC.

Anyway , perhaps, if masses move with "normal" speeds and accelerations (say, speeds below 1/100 c), light equations must be relatively simple, probably not that much harder than usual projectile motion equations.
(but you'll not be able to do spinning blackholes... )

Share this post


Link to post
Share on other sites
Quote:
Original post by Ilici
Quote:
Original post by johnb

if you use the equation you quote, treating light as a particle travelling at light-speed that can be diverted but not slowed (instead experiencing a doppler effect escaping strong gavitational fields).

I don't know how close this is to the 'correct' GR maths but I suspect it will either be almost correct or out by a magnitude which you can correct for by comparing your simulation with real examples of e.g. gravitation lensing.


Sounds good, i was thinking along the same lines but this sort of raytracing would be step by step, like doing it in a voxel field.

My formula gives nice results for static masses, but does not allow gravitational waves from moving ones. Any ideas on how to do those? I'm imagining it like a fluid simulation where energy flows between grid points.

oh, i'm sure gravitation waves is exactly what's hard. And computationally intensive (you have to make some kind of 3D grid).

I'm now almost sure that for light, most of GR equations is simpler than for fast projectile.

Share this post


Link to post
Share on other sites

This topic is 4815 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this