The flattenedClone() method and presentationNode

I am creating a level editor for a game that uses SceneKit. One of the features of the level editor is "optimization". Material textures are combined into texture atlases, materials and texture coordinates are corrected for all geometry, and then all static geometry is combined into one or more nodes via the SCNNode flattenClone() method.


The editor keeps track of many metrics such as number of primitives, number of geometries, and number of draw calls for each level. I have noticed the following:


When a node hierarchy is flattened, the combined geometry is not added directly to the node returned from flattenedClone() as suggested by the documentation. Instead, the combined geometry is added to the presentationNode of the node returned from flattenedClone(). The documentation states, "A new single node containing the combined geometries and materials of the node and its child node subtree."

Is there a rationale for using the presentationNode this way? Is there any danger incurred if I simply move the combined geometry from the presentationNode back to the "regular" node that owns the presentation node?


It may not be not possible to flatten a node hierarchy that contains more than 65536 primitives. If true, this is presumably because 16-bit element indexes are used per geometry and each node can only have one geometry. Can anyone verify this constraint?

Replies

This seems out of date. There is no presentationNode field, only a presentation field. And its geometry field is empty.