Deleting nodes and merging scene graphs
Our scene graph management routines, as described earlier in this chapter, are incomplete without a few additional operations:
- Deleting scene nodes
- Merging multiple scenes into one (in our case, combining the exterior and interior objects of the Bistro scene)
- Merging material and mesh data lists
- Merging multiple static meshes with the same material into a single, larger mesh
These operations are crucial for the final demo application of this chapter. In the original Lumberyard Bistro scene, a large tree in the backyard contains thousands of small orange and green leaves, which represent nearly two-thirds of the total draw call count in the scene – approximately 18'000
out of 27'000
objects.
This recipe describes the deleteSceneNodes()
and mergeNodesWithMaterial()
routines, which are used for manipulating the scene graph. Along with the next recipe Rendering large scenes, these functions...