Most efficient way to represent a triangular mesh

In geometry which will exclusively be a triangular mesh created programmatically, is TIndexedTriangleSetNode more efficient to use than TIndexedFaceSetNode?

Sorry for a delay in answering! After pushing some big things to CGE lately, I’m going back to my “communication backlog” and will answer some pending posts today.

As for the question – in short, yes, TIndexedTriangleSetNode will be a bit more efficient.

  • TIndexedFaceSetNode has to be “deconstructed” intro triangles internally. While it is rather easy job (as long as TIndexedFaceSetNode.Convex remains true, which is default) it’s still an additional job – completely unnecessary if your input is already a set of triangles.

  • TIndexedTriangleSetNode maps more directly to what GPU expects, at least in some cases.

Note that, depending on the use-case, the difference may be negligible, and so the advise “just use whatever is comfortable, if it doesn’t affect performance” applies. But if both options are open, and your input is naturally limited to triangles, then TIndexedTriangleSetNode is a more straightforward fit.

Thank you