I am working on ray tracing, and decided to use bounding boxes( axis aligned bbox) as objects (cubes), and shade them. I am able to find the correct t value, and intersection point; however, I could not find a way to calculate the surface normal since I only have ray direction, ray origin, intersection point, and t value, and min-max values of the bbox.
Is there a way to calculate the normal at the intersection point (or deciding which face of the cube ray intersected) with the information I have?
I am using "An Efficientand Robust Ray–Box Intersection Algorithm" by Williams et al.