Post

Replies

Boosts

Views

Activity

Reply to `MTKView` on visionOS
It doesn't support MTKView because MTKView is designed to provide a 2-dimensional view to project 3D graphics into. Instead, you want to show a 3-dimensional view directly. You do this by using a new framework called Compositor Services to set up your metal rendering surface. To see how this works: Create a new visionOS app project in Xcode. In the project options under "Immersive Space Renderer", choose "Metal". Continue creating the project. The code you're interested in is in the file App.swift and Renderer.swift. If you already understand Metal it should be pretty straightforward once you figure out the Compositor Services APIs. Note that Metal apps don't support passthrough video at the moment, in case that's something you need. Hope this helps.
Sep ’23
Reply to Metal API supported files for models?
Warren Moore wrote a library called GLTFKit for importing glTF files and rendering them in Metal. I've used it successfully in projects. You can find it at: https://github.com/warrenm/GLTFKit I seem to recall someone saying something about a newer version, so you might want to look around for that.
Sep ’23