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.

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.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.