Ray tmin and tmax update at BVH traversal


It seems to me that the ray.tmin and ray.tmax are not getting updated during the bvh traversal. Is that correct? As in other ray tracing engines, I would expect tmin and tmax to correspond to the t value of the ray entering and leaving the bounding box of that object.

In that case, would it be possible to access the Aabb of the geometry within the intersection program? Without explicitly defining it as a variable to save some memory.


That’s not how it works. The intersection program only calculates the potentially closest t_max value.

You do not have access to the AABB values calculated by the bounding box programs resp. internally for the GeometryTriangles during traversal. The whole BVH traversal mechanism is abstracted. In the past not all acceleration structures where BVH based, but there were also kD-trees in earlier OptiX versions.

For GeometryTriangles none of that is applicable. I could imagine why you’d like to have that accessible for some special custom geometric primitive cases, but you’d need to store the AABB in a separate buffer per primitive for that.