All the tutorials that I've found online speak about using Metal alone, without any other supporting library. But I don't understand if it's possible to create a SceneKit game and then use a Metal layer just to make some optimizations.
1 Answer
Yup! As of iOS 9, you can set a SceneKit SCNView to use a Metal renderer on devices that support it by initializing it with the SCNPreferredRenderingAPIKey
key in the options dictionary, as described here. Something along these lines should work:
let sceneView = SCNView(frame: someFrame, options:[SCNPreferredRenderingAPIKey: NSNumber(unsignedInteger: SCNRenderingAPI.Metal)])
That’s pretty much all you need to do; the way you interact with the rest of the API remains unchanged.