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)
}
}