Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!uxc!uxc.cso.uiuc.edu!m.cs.uiuc.edu!shirley From: shirley@m.cs.uiuc.edu Newsgroups: comp.graphics Subject: Re: MTV-Raytracer on ATARI ST Message-ID: <4400031@m.cs.uiuc.edu> Date: 8 Mar 89 16:22:00 GMT References: <1171@laura.UUCP> Lines: 21 Nf-ID: #R:laura.UUCP:1171:m.cs.uiuc.edu:4400031:000:726 Nf-From: m.cs.uiuc.edu!shirley Mar 8 10:22:00 1989 The problem may be pretty simple. When a ray is reflected (in the form "origin + t * direction", the next intersection is chosen to be the one where t is positive and otherwise the smallest. There will always be an intersection at t = 0 (the reflecting surface). Most ray tracers have some code like EPSILON = for all intersections find minimum t > EPSILON This avoids the problem that occurs when that t = 0 turns into a t = +small. If single precision is used the EPSILON must be bigger. I think the often-referenced SIGGRAPH ray-tracing tutorial talks about how to handle this problem in several ways, but the hack above is the easiest to implement. Peter Shirley shirley@cs.uiuc.edu