Contents

SKRenderer

An object that renders a scene into a custom Metal rendering pipeline and drives the scene update cycle.

Declaration

class SKRenderer

Mentioned in

Overview

SKRenderer allows an app to mix SpriteKit and Metal content by rendering an SKScene into a Metal command buffer. The reasons an app may do this instead of displaying a scene in SKView are:

  1. Apps that are built in Metal can mix in SpriteKit content. While it’s possible to add SKView as a subview to a Metal view, plugging SKRenderer into their Metal pipeline allows layering SpriteKit content at a specific z-position.

  2. You might be writing a SpriteKit app and decide later to take full control over some portion of renderering by implementing it with Metal, yet continue to use SpriteKit for the rest of the app. For example, you might write the environmental effects layer of your app that does fog, clouds, and rain, with custom Metal shaders, and continue to layer content below and above that with SpriteKit.

Topics

First Steps

Rendering the Scene

Driving the Scene’s Update Cycle

Configuring Performance Related Toggles

Enabling Visual Statistics for Debugging

See Also

Scene Renderers