swiftscenekitmetalmodelio

Generating MDLMesh with crease support?


I’ve been able to create a MDLMesh and convert to SCNGeometry to render in SceneKit. But I haven’t been able to get crease support in my meshes or geometry.

I just wanted to verify that I’m taking the correct steps to add crease support for my mesh.

  1. Create MDLSubmeshTopology
  2. For the new topology object assign MDLMeshBuffers to edgeCreaseIndices, edgeCreases and Int to edgeCreaseCount properties.
  3. Create MDLSubmesh with topology object.

I’m not looking for specific solutions, just a general idea of how one would go about adding crease support to a mesh. Anyone with experience on this would be great.


Solution

  • SceneKit has edgeCreasesElement and edgeCreasesSource as well as the vertexCrease semantic.

    You can take a look at the documentation for SCNGeometry.subdivisionLevel for more information.