Commit ancillary files
Added trace ray statistics so we can use this to fine tune the parameters to the model construction threads.
Retuned the split costs based on an analysis of the computational costs involved in each function
Revert change that broke calculation of intersects
Small hack to pre-calculate the global bounding box before we start constructing the tree. This produces a much nicer and more balances split structure, rendering time went down by ~40%. Also fixed a small bug with fullyContainedByChild logic that was wasting intersect calculations, so now the model builds even faster.
Also, with the pre-calculated bounding boxes, it opens the possibility for us to store the bounding box of each node as a piece of data, and this means we can save some more build and trace time by not having to keep constraining the bounding box on the way down. Also, it can potentially speed up tree construction because we now know for a fact that the bounding box of a node will not ever change due to an expanding global bounding box, we can start caching the surface areas of the triangles bounded by the node’s bounding box, so on subsequent node visits to build the tree we don’t have to recompute all that again. We just need to put it in a separate data structure separate from the entire modelContainer tree and reference it by pointers so that when we finish with constructing the tree we can destroy the surface area data structure, we can even just implement it as a cache and do it on a best-effort hit basis, its likely that in a ply file triangles that are next to each other are specified on adjacent lines, so even just a small cache-based system could have a large number of cache hits.
Randomise insertion order of model objects. This makes the tree a lot more balanced and speeds up build and traces considerably.
Refactored the code to not use pointer arrays but use vectors instead, this makes them slightly easier to work with in terms of concatenating, moving them around…etc Also decided for now not to support spheres in the plyFileParser, we will work exclusively with triangles until we can get the whole thing right.
Refactored the call structure for adding items to allow for the leaf node to skip attempting to add an item, this is to allow for future threading operations where if a leaf node is occupied by another thread we will abort and attempt to insert into that node a little bit later when it becomes free.
Added proper multi-threading to the model construction process, model build now happens in <4min for the dragon and bunny model
Refactored the progress bar and added progress bar printing to the model construction phase
fix slight merge conflict
Added a rendered sample of the dragon and bunny model
Merge branch 'master4'