Original Post
hello, have a few questions about raytracing... 1) how do you deal with computational inaccuracies. ie. ray-sphere intersection, I get a point of intersection (PI). A reflected ray then hits the sphere it has reflected off (because the PI lies on the sphere or slightly inside). I've tried to shift the PI along the ray (or normal for shadow rays). I've tried checking for results close to 0 and tried not allowing the ray to collide with the primitive that has reflected it. Neither of it works 100%. If two primitive were close enough, I can shift the PI from one into the other, the same goes with the second method. For non-conevx primitives, the third method wouldn't work. How do you deal with it 2) in shadow tests, how do you deal with refraction? I mean you can cast a ray to the light. If it hits a transparent primitive, it wouldn't prolly hit the light then. But that doesn't mean another ray from the light wouldn't! It might go a bit to the side and refract just the way we need. How do we deal with this? chances are you might have other useful info that could help me on this topic (like what you've stumbled upon when writing a raytracer). I'd highly appreciate this :) thanks. If you can hint on the questions I'[ve asked, perfect. Don't hesitate to explain if you feel like. I'll read it all thoroughly. thanks