<!--
{
  "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/SCNMaterialProperty/contents",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNMaterialProperty(py)contents"
  },
  "title" : "contents"
}
-->

# contents

The visual contents of the material property—a color, image, or source of animated content. Animatable.

```
var contents: Any? { get set }
```

## Discussion

For details on each visual property and the ways their contents affect a material’s appearance, see [`SCNMaterial`](/documentation/SceneKit/SCNMaterial).

You can set a value for this property using any of the following types:

- A color (<doc://com.apple.documentation/documentation/AppKit/NSColor>/<doc://com.apple.documentation/documentation/UIKit/UIColor> or <doc://com.apple.documentation/documentation/CoreGraphics/CGColor>), specifying a uniform color for the material’s surface
- A number (<doc://com.apple.documentation/documentation/Foundation/NSNumber>), specifying a uniform scalar value for the material’s surface (useful for physically based properties such as [`metalness`](/documentation/SceneKit/SCNMaterial/metalness))
- An image (<doc://com.apple.documentation/documentation/AppKit/NSImage>/<doc://com.apple.documentation/documentation/UIKit/UIImage> or <doc://com.apple.documentation/documentation/CoreGraphics/CGImage>), specifying a texture to be mapped across the material’s surface
- An <doc://com.apple.documentation/documentation/Foundation/NSString> or <doc://com.apple.documentation/documentation/Foundation/NSURL> object specifying the location of an image file
- A video player (<doc://com.apple.documentation/documentation/AVFoundation/AVPlayer>) or live video capture preview (<doc://com.apple.documentation/documentation/AVFoundation/AVCaptureDevice>, in iOS only)
- A Core Animation layer (<doc://com.apple.documentation/documentation/QuartzCore/CALayer>)
- A texture (<doc://com.apple.documentation/documentation/SpriteKit/SKTexture>, <doc://com.apple.documentation/documentation/ModelIO/MDLTexture>, <doc://com.apple.documentation/documentation/Metal/MTLTexture>, or <doc://com.apple.documentation/documentation/GLKit/GLKTextureInfo>)
- A SpriteKit scene (<doc://com.apple.documentation/documentation/SpriteKit/SKScene>)
- A specially formatted image or array of six images, specifying the faces of a cube map

When you examine elements of a scene loaded from a file, this value is always either a color object (of the <doc://com.apple.documentation/documentation/AppKit/NSColor> or <doc://com.apple.documentation/documentation/UIKit/UIColor> class, according to platform) or an image object (of the <doc://com.apple.documentation/documentation/AppKit/NSImage> or <doc://com.apple.documentation/documentation/UIKit/UIImage> class, according to platform). You can therefore use type introspection (the <doc://com.apple.documentation/documentation/ObjectiveC/NSObjectProtocol/isKind(of:)> method in Objective-C, or the `is` operator or `let`-`as` matching in Swift) to determine the type of the material property’s contents.

### Using Animated Content

In iOS 11, you may use an <doc://com.apple.documentation/documentation/AVFoundation/AVCaptureDevice> object to preview live video from a capture device as a material property. In iOS 11, tvOS 11, and macOS 10.13, you may use an <doc://com.apple.documentation/documentation/AVFoundation/AVPlayer> object as a material property for video playback.

You may specify any Core Animation layer as the contents of a material property, such as a layer with an animated sublayer hierarchy. SceneKit cannot use a layer that is already being displayed elsewhere (for example, the backing layer of a <doc://com.apple.documentation/documentation/UIKit/UIView> object).

You can use the SpriteKit framework to provide static or animated content for a material property. SpriteKit provides options for generating and modifying texture images, such as the <doc://com.apple.documentation/documentation/SpriteKit/SKTexture/generatingNormalMap()> method. You can also use an entire animated SpriteKit scene as the material property’s contents. When you use a <doc://com.apple.documentation/documentation/SpriteKit/SKTexture> object as a material property’s contents, the [`wrapS`](/documentation/SceneKit/SCNMaterialProperty/wrapS), [`wrapT`](/documentation/SceneKit/SCNMaterialProperty/wrapT), [`contentsTransform`](/documentation/SceneKit/SCNMaterialProperty/contentsTransform), [`minificationFilter`](/documentation/SceneKit/SCNMaterialProperty/minificationFilter), [`magnificationFilter`](/documentation/SceneKit/SCNMaterialProperty/magnificationFilter) and [`mipFilter`](/documentation/SceneKit/SCNMaterialProperty/mipFilter) properties automatically update to match the corresponding features of the SpriteKit texture.

If the current content is a solid color, you can use explicit or implicit animations (see [Animating SceneKit Content](/documentation/SceneKit/animating-scenekit-content)) to change to another color, creating an effect that fades between the two colors. Using animations to change from or to other content types results in an instantaneous transition—for an animated transition between textured content types (or types that are themselves animated), create a shader modifier (see [`SCNShadable`](/documentation/SceneKit/SCNShadable)).

### Using Cube Map Texures

SceneKit supports cube maps only for a material’s [`reflective`](/documentation/SceneKit/SCNMaterial/reflective) property or for a scene’s [`background`](/documentation/SceneKit/SCNScene/background) or [`lightingEnvironment`](/documentation/SceneKit/SCNScene/lightingEnvironment) property. You can provide a cube map in any of the ways described in Table 1. Of these formats, the vertical strip provides the best performance, because it matches the memory layout SceneKit uses for rendering cube textures.

|Description                                                                                                            |Image Size Requirements                             |Example                                                                                                                 |
|-----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
|Vertical strip (single image)                                                                                          |height == 6 * width                                 |![](media-2557196)                                                                                                      |
|Horizontal strip (single image)                                                                                        |6 * height == width                                 |![](media-2557198)                                                                                                      |
|Spherical projection (single image) ![](spacer) (pixel x/y positions map to latitude/longitude coordinates on a sphere)|2 * height == width                                 |![](media-2557205)                                                                                                      |
|Array of six images ![](spacer) (face order: +X, -X, +Y, -Y, +Z, -Z)                                                   |height == width ![](spacer) same size for all images|[![](media-2557210), ![](media-2557212), ![](media-2557215), ![](media-2557218), ![](media-2557221), ![](media-2557226)]|

---

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)