1

Calling the snapshot function of SCNView from inside of renderer(_:didRenderScene:atTime:) fails after a few frames.

Putting a breakpoint inside renderer(_:didRenderScene:atTime:) shows that the code gets executed for a few frames then stops.

1) Is snapshot too heavy to call inside of renderer(_:didRenderScene:atTime:)?

2) The goal is to turn changes to a SCNView into a video. Other questions are similar, but none of those solutions worked. Is there another way to render a SCNScene into video?

func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) {
    if sceneViewScreenshotDelegate != nil {
        let snapshot = sceneView.snapshot()
        sceneViewScreenshotDelegate?.sceneDidRenderScreenshot(image: snapshot)
    }
}
Crashalot
  • 33,605
  • 61
  • 269
  • 439
  • This won't work on a device (standalone) and probably isn't what you want... but you can use Screenflow to capture reasonably high quality videos. Much better quality than the results from Quicktime. But they do have compression and aren't native resolution (lower). Only useful if you need to show development partners or to promote the game. Not as on-device rendering, which is probably what you're after. – Confused Apr 01 '18 at 11:28
  • iOS 11's ability to record the screen MASSIVELY degrades the quality of video capture if a lot is going on and/or processor power demands are high. – Confused Apr 01 '18 at 11:30
  • @Confused exactly, how do you achieve on-device scenekit rendering to a video? – Crashalot Apr 01 '18 at 23:54

0 Answers0