I've managed to add the bounding boxes optimization to the program and here's some good advice: read the book carefully!
I didn't, and wasted more than one hour debugging code that I should have never written in the first place... d'oh!!!
But opening the book again and following more closely the directions got me back on the right track luckily, and got the feature working.
So far, it seems to be a big win. Very good speedups on the triangle meshes, and little or no effect on the simpler scenes. I found it useful being able to visualize the bounding boxes, so I added the possibility of converting a bounding box into a cube (transparent and without shadow) and adding it to the scene.
Isolating a subgroup of the hexagon:
In my favorite scene:
Same scene, but this time the boxes are ignored by secondary rays:
Without seeing your implementation I'm kind of guessing, but see if any of this helps.
First, make sure that these cubes are ignored by the shadow calculations. Shadow rays should ignore them. That makes sure that they don't cast shadows on anything inside of them.
Second, try setting ambient to 0, and diffuse to (1 - transparency). That is to say, since you've got transparency set to 0.8, try setting diffuse to 0.2. A constant ambient value with no diffuse component will make the boxes look very flat.
My settings are (0.5, 0.5, 0) for the Color and Transparency = 1. Also Ambient is 0 or 0.1. Shadows are off for these objects.
The first screenshot you posted looks cool in a peculiar way! If you're using bounding boxes for the hit tests, I think it's worth trying to disable them temporarily (while still showing the yellow boxes) and check if the scene changes.
I did have shadows off for the bounding box cube, but I had not yet added the ability to disable secondary rays. So after I added the ability to have a shape disable reflection and refraction rays, the weirdness from that complex scene went away.
I will say that it has definitely been worth my time figuring this out. Having the visible bounding boxes helped me find and fix a bug with my groups that made rendering complex obj files WAY faster. Basically, I forgot to implement get_bounds() on my triangle primitive and thus my bounding boxes on groups were infinitely small, causing every triangle to always be hit tested for every ray...ouch.