Ray-Triangle Intersection Algorithm for Modern CPU Architectures
Maxim Shevtsov, Alexei Soupikov, Alexander Kapustin, Nizhniy Novgorod · 2007
We present an algorithm for determining if a ray intersects a triangle interior; and computing intersection point parameters as well as distance of intersection in response to the ray intersecting a triangle interior. Particularly a variation of a hybrid test having all benefits of Plücker and projected barycentric tests is proposed. The test is also vectorized using SIMD instructions for efficient handling ray packets. It is essential for achieving high ray tracing performance on modern CPUs. Our implementation also detects axis-orthogonal triangles and processing them separately. For maximum performance we also introduce a method for triangle representation, using only necessary pre-computed values. We also present inherently thread-safe and memory efficient alternative of mailboxing to avoid unnecessary intersection tests for ray packet in case when many leaves share the same triangle.