Lecture 9: Ray Tracing & Acceleration Structures (20)
litony396

How much more efficient is this algorithm compared to using the method shown in the previous slides? We are given a cost for this algorithm but what is the cost of the other algorithm?

spegeerino

@litony396 I think, very loosely, the other algorithm has the cost of finding the ray-plane intersection (which involves a system of 3 linear equations in 3 variables, which takes at least 3^3 add/mul operations, i think) and then doing triangle containment on top of that which is 3 line tests along with checking orientation of the points which is another 3^3 add/mul computations at least, so this is definitely significantly faster.

angelinelykk

To add on a little to this, if we used the 3 points of a triangle as p1, p2, p3. Then 1-b1-b2, b1 and b2 are essentially the barycentric coordinates. Therefore, we can check that all of them are more than or equal to 0 to ensure that there is an intersection as covered in previous lectures.

You must be enrolled in the course to comment