Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AR without SceneKit

naru-jpn
February 07, 2018

AR without SceneKit

Create AR application using Metal without SceneKit

naru-jpn

February 07, 2018
Tweet

More Decks by naru-jpn

Other Decks in Programming

Transcript

  1. ARKit Camera SceneKit Pixel Buffer 3D Info Rendering ARSCNView Light

    Estimation Plane Detection Manage 3D Objects
  2. ARKit Camera SceneKit Pixel Buffer 3D Info Rendering ARSCNView Light

    Estimation Plane Detection Manage 3D Objects
  3. // Defined in ARSessionDelegate // Called when ARFrame is updated

    func session(_ session: ARSession, didUpdate frame: ARFrame) { // … }
  4. A running AR session continuously captures video frames from the

    device camera. For each frame, ARKit analyzes the image together with data from the device's motion sensing hardware to estimate the device's real-world position. ARFrame https://developer.apple.com/documentation/arkit/arframe
  5. Pipeline of off-screen rendering Filter Draw Instances ARFrame MTLTexture MPSImageSobel

    declared in Metal Performance Shaders Draw video frame Commands sent to GPU
  6. Making Image to save drawHierarchy(in:afterScreenUpdates:) MTLTexture → CGImage 7.0 ~

    10.0 ms available on background thread 30.0 ~ 40.0 ms required to execute on main thread