Abe Stephens wrote:
Also, calling computeBounds on a group that contains lots of things (imagine a 10M tri statue) is a major bottleneck on a multi core system. Could we parallelize computeBounds? Can we make Group::computeBounds return an already precomputed bbox and do the actual bounding box calculation elsewhere?
DynBVH does this, it calls extendByBox on the input bounding box and passes in the bounds of the root node... The bounds are computed during a call to rebuild.
Abe
Sorry, I didn't explain exactly what is going on. During an animation, Group will interpolate from the old frame to the new frame. While doing so it looks at all the primitives, so computing the bounding box while that occurs would introduce a minor overhead (anywhere else and it is considerably more expensive). Then when DynBVH or any other acceleration structure takes that newly built group, it should be able to call computeBounds on it and the Group will realize it just computed that and return a precomputed bounding box. Doing this in the acceleration structure is bad because a group might be used in more than one acceleration structure. So what I want to do is precompute the bbox in the Group::interpolate function and then use that. This does of course introduce issues where something might modify an object contained by Group without Group knowing about it. It's for these ugly reasons that I was wondering what others recommended.
Archive powered by MHonArc 2.6.16.