Protocol

SCNSceneRenderer

Methods and properties common to the SCNView, SCNLayer, and SCNRenderer classes.

Declaration

@protocol SCNSceneRenderer

Overview

You use an instance of one of these classes to display a scene and manage SceneKit’s rendering and animation of the scene’s contents.

Typically, you use the SCNView class to display a scene in a window (or full screen). You can create and configure a SceneKit view programmatically or in Interface Builder. The other renderer classes render SceneKit content in more specialized situations. If your app has a user interface composed of Core Animation layers, you can use the SCNLayer class to render a scene into a layer. If your app uses Metal or OpenGL for other rendering, you can use the SCNRenderer class to render SceneKit content with the same Metal device or OpenGL context.

Use the scene property of the view, layer, or renderer to specify the scene to display.

Topics

Presenting a Scene

scene

The scene to be displayed.

Required.

- presentScene:withTransition:incomingPointOfView:completionHandler:

Displays the specified scene with an animated transition.

Required.

Managing Scene Display

pointOfView

The node from which the scene’s contents are viewed for rendering.

Required.

autoenablesDefaultLighting

A Boolean value that determines whether SceneKit automatically adds lights to a scene.

Required.

jitteringEnabled

A Boolean value that determines whether SceneKit applies jittering to reduce aliasing artifacts.

Required.

showsStatistics

A Boolean value that determines whether SceneKit displays rendering performance statistics in an accessory view.

Required.

debugOptions

Options for drawing overlay content in a scene that can aid debugging.

Required.

renderingAPI

The graphics technology SceneKit uses to render the scene.

Required.

SCNDebugOptions

Options for drawing overlays with SceneKit content that can aid in debugging, used with the debugOptions property.

SCNRenderingAPI

Options for choosing the graphics technology for an SCNView object (or other SceneKit renderer) to use for drawing its contents. Used by the renderingAPI property and the SCNPreferredRenderingAPIKey option when initializing an SCNView object.

Managing Scene Animation Timing

sceneTime

The current scene time.

Required.

playing

A Boolean value that determines whether the scene is playing.

Required.

loops

A Boolean value that determines whether SceneKit restarts the scene time after all animations in the scene have played.

Required.

Preloading Renderer Resources

- prepareObject:shouldAbortBlock:

Prepares a SceneKit object for rendering.

Required.

- prepareObjects:withCompletionHandler:

Prepares the specified SceneKit objects for rendering, using a background thread.

Required.

Working With Projected Scene Contents

- hitTest:options:

Searches the renderer’s scene for objects corresponding to a point in the rendered image.

Required.

SCNHitTestOption

Options affecting the behavior of SceneKit hit-testing methods.

- isNodeInsideFrustum:withPointOfView:

Returns a Boolean value indicating whether a node might be visible from a specified point of view.

Required.

- nodesInsideFrustumWithPointOfView:

Returns all nodes that might be visible from a specified point of view.

Required.

- projectPoint:

Projects a point from the 3D world coordinate system of the scene to the 2D pixel coordinate system of the renderer.

Required.

- unprojectPoint:

Unprojects a point from the 2D pixel coordinate system of the renderer to the 3D world coordinate system of the scene.

Required.

Participating in the Scene Rendering Process

delegate

A delegate object that receives messages about SceneKit’s rendering process.

Required.

Customizing Scene Rendering with Metal

currentRenderCommandEncoder

The Metal render command encoder in use for the current SceneKit rendering pass.

Required.

device

The Metal device this renderer uses for rendering.

Required.

commandQueue

The Metal command queue this renderer uses for rendering.

Required.

colorPixelFormat

The Metal pixel format for the renderer’s color output.

Required.

depthPixelFormat

The Metal pixel format for the renderer’s depth buffer.

Required.

stencilPixelFormat

The Metal pixel format for the renderer’s stencil buffer.

Required.

Customizing Scene Rendering with OpenGL

context

The OpenGL rendering context that SceneKit uses for rendering the scene.

Required.

Rendering Sprite Kit Content over a Scene

overlaySKScene

A Sprite Kit scene to be rendered on top of the SceneKit content.

Required.

Working With Positional Audio

audioListener

The node representing the listener’s position in the scene for use with positional audio effects.

Required.

audioEnvironmentNode

The 3D audio mixing node SceneKit uses for positional audio effects.

Required.

audioEngine

The audio engine SceneKit uses for playing scene sounds.

Required.

Instance Properties

currentTime

Required.

Deprecated
currentViewport

Required.

Beta
usesReverseZ

Required.

Beta

Relationships

Inherits From

See Also

Display and Interactivity

SCNSceneRendererDelegate

Methods your app can implement to participate in SceneKit’s animation loop or perform additional rendering.

SCNLayer

A Core Animation layer that renders a SceneKit scene as its content.

Deprecated
SCNRenderer

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

SCNHitTestResult

Information about a the result of a scene-space or view-space search for scene elements.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software