There is a typo here: BVHNode* second should be (hit1.t<=hit2.t) ? child2 : child1
janeqi417
I am a little confused here. If we want to check whether second child's t is closer than closest.t, we need to compute one more to get second child's t, right. In this way, we only reduce the computation of one child node, right?
jkalapos
I think we need to compute the intersect for second and if that t is less than our closest t then we'll have to check inside the second node. If the t is not less than the closest t then we don't have to check that second child node which is great because that whole node could have had a large amount of triangles and now we've completely avoided looking at them.
anonymous
@janeqi417 I think that second child's t is its bounding box's t.
There is a typo here: BVHNode* second should be (hit1.t<=hit2.t) ? child2 : child1
I am a little confused here. If we want to check whether second child's t is closer than closest.t, we need to compute one more to get second child's t, right. In this way, we only reduce the computation of one child node, right?
I think we need to compute the intersect for second and if that t is less than our closest t then we'll have to check inside the second node. If the t is not less than the closest t then we don't have to check that second child node which is great because that whole node could have had a large amount of triangles and now we've completely avoided looking at them.
@janeqi417 I think that second child's t is its bounding box's t.