<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNSceneRenderer/prepare(_:shouldAbortBlock:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(pl)SCNSceneRenderer(im)prepareObject:shouldAbortBlock:"
  },
  "title" : "prepare(_:shouldAbortBlock:)"
}
-->

# prepare(_:shouldAbortBlock:)

Prepares a SceneKit object for rendering.

```
func prepare(_ object: Any, shouldAbortBlock block: (() -> Bool)? = nil) -> Bool
```

## Parameters

`object`

An [`SCNScene`](/documentation/SceneKit/SCNScene), [`SCNNode`](/documentation/SceneKit/SCNNode), [`SCNGeometry`](/documentation/SceneKit/SCNGeometry), or [`SCNMaterial`](/documentation/SceneKit/SCNMaterial) instance.

`block`

A block that SceneKit calls periodically while preparing the object. The block takes no parameters.

    Your block should return     <doc://com.apple.documentation/documentation/Swift/false>     to tell SceneKit to continue preparing the object, or     <doc://com.apple.documentation/documentation/Swift/true>     to cancel preparation.

    Pass     `nil`     for this parameter if you do not need an opportunity to cancel preparing the object.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the object was successfully prepared for rendering, or <doc://com.apple.documentation/documentation/Swift/false> if preparation was canceled.

## Discussion

By default, SceneKit lazily loads resources onto the GPU for rendering. This approach uses memory and GPU bandwidth efficiently, but can lead to stutters in an otherwise smooth frame rate when you add large amounts of new content to an animated scene. To avoid such issues, use this method to prepare content for drawing before adding it to the scene. You can call this method on a secondary thread to prepare content asynchronously.

SceneKit prepares all content associated with the `object` parameter you provide. If you provide an [`SCNMaterial`](/documentation/SceneKit/SCNMaterial) object, SceneKit loads any texture images assigned to its material properties. If you provide an [`SCNGeometry`](/documentation/SceneKit/SCNGeometry) object, SceneKit loads all materials attached to the geometry, as well as its vertex data. If you provide an [`SCNNode`](/documentation/SceneKit/SCNNode) or [`SCNScene`](/documentation/SceneKit/SCNScene) object, SceneKit loads all geometries and materials associated with the node and all its child nodes, or with the entire node hierarchy of the scene.

You can use the `block` parameter to cancel preparation if content is no longer needed. For example, in a game you might use this method to preload areas of the game world the player is soon to enter, but if the player character dies before entering those areas, you can return <doc://com.apple.documentation/documentation/Swift/true> from the block to cancel preloading.

You can observe the progress of this operation with the <doc://com.apple.documentation/documentation/Foundation/Progress> class. For details, see <doc://com.apple.documentation/documentation/Foundation/Progress>.

---

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)