<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKRenderer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKRenderer"
  },
  "title" : "SKRenderer"
}
-->

# SKRenderer

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

```
class SKRenderer
```

## Overview

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

1. Apps that are built in Metal can mix in SpriteKit content. While it’s possible to add [`SKView`](/documentation/SpriteKit/SKView) as a subview to a Metal view, plugging [`SKRenderer`](/documentation/SpriteKit/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

Create a renderer by specifying a GPU and then set its scene.

[`init(device:)`](/documentation/SpriteKit/SKRenderer/init(device:))

Initializes with a specific GPU to render into.

[`scene`](/documentation/SpriteKit/SKRenderer/scene)

The scene this renderer will draw into the Metal command buffer.

### Rendering the Scene

Draw the renderer’s scene into a custom Metal rendering pipeline.

[`render(withViewport:commandBuffer:renderPassDescriptor:)`](/documentation/SpriteKit/SKRenderer/render(withViewport:commandBuffer:renderPassDescriptor:))

[`render(withViewport:renderCommandEncoder:renderPassDescriptor:commandQueue:)`](/documentation/SpriteKit/SKRenderer/render(withViewport:renderCommandEncoder:renderPassDescriptor:commandQueue:))

### Driving the Scene’s Update Cycle

Control when the scene’s delegate functions are called.

[`update(atTime:)`](/documentation/SpriteKit/SKRenderer/update(atTime:))

### Configuring Performance Related Toggles

Control hints that have performance implications which are unique to your app.

[`ignoresSiblingOrder`](/documentation/SpriteKit/SKRenderer/ignoresSiblingOrder)

[`shouldCullNonVisibleNodes`](/documentation/SpriteKit/SKRenderer/shouldCullNonVisibleNodes)

### Enabling Visual Statistics for Debugging

Display metrics in the bottom corner of the scene’s frame for debugging purposes.

[`showsNodeCount`](/documentation/SpriteKit/SKRenderer/showsNodeCount)

A Boolean value that indicates whether the view displays an overlay that shows physics bodies that are visible in the scene.

[`showsDrawCount`](/documentation/SpriteKit/SKRenderer/showsDrawCount)

A Boolean value that indicates whether the view displays the number of drawing passes it needed to render the view.

[`showsQuadCount`](/documentation/SpriteKit/SKRenderer/showsQuadCount)

A Boolean value that indicates whether the view displays the number of rectangles used to render the scene.

[`showsPhysics`](/documentation/SpriteKit/SKRenderer/showsPhysics)

A Boolean value that indicates whether the view displays physics-related debugging information.

[`showsFields`](/documentation/SpriteKit/SKRenderer/showsFields)

A Boolean value that indicates whether the view displays information about physics fields in the scene.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)