Search This Blog

Friday, May 17, 2013

Machine epsilon in Ray tracer

Because of inaccuracy of floating point calculation in computer system, ray-tracer could fail ray-intersection test. For instance, the calculated intersection point might lie below or above the actual surface. This problem makes self-intersection of secondary rays or overlap of geometries. In order to handle this problem appropriately, we usually add a small distance along the ray (rayepsilon in PBRT) or normal direction. However, it is also important to choose an epsilon value. H. Dammertz said that too small epsilon results i self-intersections of secondary rays, too large epsilon results in overlaps from the extended geometry.

Ray-tracing for transparent or translucent objects, it is important to trace rays not only the surface facing a camera, but also the surface hidden from the camera. Ray-tracer would fail to intersection test for the hidden surface which is very close to the surface which the rays already intersected. If we modeled the volume with some interfaces, outside will be air and inside will be a material. To check if the ray is within the volume, ray-intersection test will be important. When ray intersects the first surface, the ray will get into the volume. When the ray intersects the second surface, the ray will get out of the volume. When second surface is too close to the first surface, ray-tracer would fail to detect the intersection and regard the ray still within the volume, even though the ray already got out of the volume.

How do I handle this issue?


No comments:

Post a Comment

Blog Archive