Open johnhaddon opened 10 years ago
I principle I do like the idea of the merging node (because of its flexibility - one might not want to do any raytracing etc); however with gaffer expanding all bounding boxes, this approach would still lead to a very slow graph in the ui?
I like the idea of the merging node too. I would expect it to be a bit slower but I think it'd be worth prototyping it to see rather than first writing the more specialised solution first.
agreed, especially if the instancer does get an option to create an approximate bbox based on the incoming point data as per #957 the speed issue might not be so bad
Cool - that sounds like a plan then. Adding an approximate bound is easy - much easier than doing the accurate bound, so we can get that in quickly whenever it gets prioritised.
I've updated the title on this one to be a MeshMerge node, as discussed previously. I'd propose that it works as follows :
parent
plug specifies the location where the merged mesh will be createdname
plug specifies the name of the merged meshfilter
input specifies the meshes to be mergedpruneOriginalMeshes
toggle causes the original meshes to be pruned from the sceneIn terms of implementation, I think we can derive from BranchCreator
to do the work of making the merged mesh, and use a Prune
node to do the pruning work. Those would be child implementation nodes of the main MeshMerge
node.
There's code for merging two meshes in Cortex, which I think would provide a useful reference. But since we want to merge an arbitrary number of meshes, I think it's important that we do that in one step for speed. We might still want to put the "merge multiple meshes" code in Cortex somewhere anyway, perhaps in a new MeshAlgo.h
file, since we've been discussing making Cortex functionality available directly in functions as well as via the higher level Ops
.
How does that sound?
We would like the ability to instance meshes on to a point cloud as the
Instancer
does, but merging all the meshes into a single object ideal for raytracing (think leaves on a tree or banknotes on the wind). One approach would be to have an instancer style node (or an extension to the existing node) which simply outputs a single mesh. Another would be to use the instancer as-is, and have a subsequent MeshMerge node which collapses a hierarchy of meshes into a single object.