<!--
{
  "documentType" : "article",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/creating-a-new-node-by-rendering-to-a-texture",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Creating a New Node By Rendering To a Texture"
}
-->

# Creating a New Node By Rendering To a Texture

Render a portion of the node tree into a new texture.

## Discussion

You can create a texture from some portion of on-screen content with [`texture(from:)`](/documentation/SpriteKit/SKView/texture(from:)), or its variation, [`texture(from:crop:)`](/documentation/SpriteKit/SKView/texture(from:crop:)). Both of these functions are available for scenes rendered by [`SKView`](/documentation/SpriteKit/SKView) or <doc://com.apple.documentation/documentation/WatchKit/WKInterfaceSKScene>.

There are a couple reasons you might want to do this, for example:

- Creating a new sprite node whose texture reflects prior shading done with [`SKShader`](/documentation/SpriteKit/SKShader)
- Flattening a hierarchy of nodes into a texture, either for performance, or to apply some effect. Note that this can also be done using [`SKEffectNode`](/documentation/SpriteKit/SKEffectNode) and setting [`shouldRasterize`](/documentation/SpriteKit/SKEffectNode/shouldRasterize) to true.
- Breaking appart an existing node into separate nodes, for example, for an explosion effect.

---

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)