Render ARKit Session using both SceneKit and MetalKit

I am working with ARKit4 and I want to use MetalKit as well as SceneKit to render the session. I have a MTKView and a ARSCNView on top of it. I am using the MTKView to render the RGB images as show cased here: https://developer.apple.com/documentation/arkit/visualizing_a_point_cloud_using_scene_depth

And I want to render the ARKit scene reconstruction mesh as well. That is why I need to use ARSCNView. However, I am unable to initialize the ARSession for both the views. Only one works at a time.

Is it possible to use both the frameworks( SceneKit and MetalKit) simultaneously for rendering ARKit mesh?
Hello,

There are several different ways that you can use SceneKit and Metal together.

Based on what you have described, I recommend that you continue with MTKView, do whatever drawing you need to do with Metal, and then use an SCNRenderer to render your SceneKit scene, just make sure that you give the SCNRenderer the currentRenderPassDescriptor from the MTKView when it comes time to call render(atTime:viewport:commandBuffer:passDescriptor:).

Render ARKit Session using both SceneKit and MetalKit
 
 
Q