Class

SCNRenderer

A renderer for displaying SceneKit scene in an an existing Metal workflow or OpenGL context.

Overview

Use this class when you want to add content rendered by SceneKit to an app that already renders other content by using Metal or OpenGL or OpenGL ES directly. To provide content for a SceneKit renderer, assign a SCNScene object to its scene property.

For additional important methods and properties for working with SceneKit renderers, see SCNSceneRenderer.

Symbols

Creating a Renderer

init(device: MTLDevice?, options: [AnyHashable : Any]? = nil)

Creates a renderer with the specified Metal device.

init(context: EAGLContext?, options: [AnyHashable : Any]? = nil)

Creates a renderer with the specified OpenGL context.

Specifying a Scene

var scene: SCNScene?

The scene to be rendered.

Managing Animation Timing

var nextFrameTime: CFTimeInterval

The timestamp for the next frame to be rendered.

Rendering a Scene Using Metal

func render(atTime: CFTimeInterval, viewport: CGRect, commandBuffer: MTLCommandBuffer, passDescriptor: MTLRenderPassDescriptor)

Renders the scene’s contents at the specified system time in the specified Metal command buffer.

Rendering a Scene Using OpenGL

func render()

Renders the scene’s contents in the renderer’s OpenGL context.

Deprecated
func render(atTime: CFTimeInterval)

Renders the scene’s contents at the specified system time in the renderer’s OpenGL context.

Capturing a Snapshot

func snapshot(atTime: CFTimeInterval, with: CGSize, antialiasingMode: SCNAntialiasingMode)

Creates an image by drawing the renderer’s content at the specified system time.