3 ms·
> Not to sound too crazy but I also have a strong suspicion that if you tied a physics engine to a raytracer, you might get your physics 'for free' which could
by electricslpnsld 9y ago
> Not to sound too crazy but I also have a strong suspicion that if you tied a physics engine to a raytracer, you might get your physics 'for free' which could be a big deal for pushing forward more realistic physics too.
Why is that?
- whatshisface 9y agoTo my knowledge, the biggest part of game physics is collision detection. (There's a lot more floats in the geometry of a rigid body than there are in its motion vectors). If you had a perfect raytracer for "free," you could fire out a fiber bundle from moving objects in the direction of their motion to find out what they'd hit.
- Retra 9y agoHow is that free though? You have to fire more rays for each moving object. That's not cheap. And the only thing you get is variable accuracy collision detection.
- onion2k 9y agoYou wouldn't have to fire out more rays if you could use the same ones that are used for calculating light bounces.
- simias 9y agoYou'd have to be lucky enough to have a ray of light bouncing in the right position and direction, and you'd have to be clever enough to notice it at the right moment (without slowing down regular light tracing algorithm by adding a billion comparison everywhere to figure out if it matches a motion vector). I don't want to be a naysayer after only considering it for two minutes but it doesn't sound very practical to me.
- vanderZwan 9y agoSounds like it would lead to interesting "not a bug, it's a feature!"-worthy result of clipping through objects in the dark
- pasquinelli 9y agothe main thing with collision detection is narrowing what to search. consider a game with a million spheres: what can you do to narrow it down so you don't have to test each sphere against 999,999 others every frame. firing out a fiber bundle is akin to saying, "find the distance between each pair of spheres and compare that distance to the sum of the radiuses of the spheres." yes, that is a test for sphere to sphere collision, but it misses the problem.