Generating mesh with crease support?

I’ve been able to create a mesh and convert to SCNGeometry for rendering in SceneKit. But I haven’t been able to get crease support in my meshes or geometries.


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.

Replies

Hello Phi,


I'm sorry that I don't have an answer for you. I have been looking for the same information. I have had no luck

generating the crease information as well. I can generate smooth normals by specifying a crease threshold as

in the line of code below. But I can find no examples and Apple docs do not help.


mdlMesh?.addNormals(withAttributeNamed: MDLVertexAttributeNormal, creaseThreshold: 0.85)


Have you had any luck since your post? Thanks.