Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

trouble with MDLMesh.newBo()

I made a box with MDLMesh.newBox(). I added normals.

             let mdlMesh = MDLMesh.newBox(withDimensions: SIMD3<Float>(1, 1, 1),
                                 segments: SIMD3<UInt32>(2, 2, 2),
                                 geometryType: MDLGeometryType.triangles,
                                 inwardNormals:false,
                                 allocator: allocator)

mdlMesh.addNormals(withAttributeNamed: MDLVertexAttributeNormal, creaseThreshold: 0.25)

After I convert to MTKMesh the normals are (0,0,0) for a group of vertices. I can only inspect the geometry after I convert to MTKMesh. Is there a way you can use Geometry Viewer on a MDLMesh?

trouble with MDLMesh.newBo()
 
 
Q