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

# SCNScene

A container for the node hierarchy and global properties that together form a displayable 3D scene.

```
class SCNScene
```

## Overview

To display 3D content with SceneKit, you create a scene containing a hierarchy of the nodes and attributes that together represent your visual elements. Typically, you build your assets in a 3D visual editor, then assemble them into a scene using Xcode’s SceneKit Scene Editor, ready for SceneKit to render.

![At the left, a diagram showing a simple scene composed of the node hierarchy and presentation attributes. At the right, the resulting rendered scene.](images/com.apple.scenekit/media-2994226@2x.png)

To display your scene, you need to load it at runtime, then set it as the scene property of an [`SCNView`](/documentation/SceneKit/SCNView):

```swift
guard let myScene = SCNScene(named: "MyScene") 
    else { fatalError("Unable to load scene file.") }
scnView.scene = myScene // Your app's SCNView
```

### Creating a Scene

The simplest way to create a scene is through Xcode’s SceneKit Scene Editor. Start by importing one or more assets from a 3D editor, such as Blender. Then you adjust the positions and attributes of the assets, and set global scene properties, such as lighting environment, to compose your scene. The scene editor creates a `.scn` file, which you save to a `.scnassets` folder in the app bundle. When you build your project, Xcode optimizes the scene file for your target platform.

## Topics

### Creating a Scene from a File

[`+  scene`](/documentation/SceneKit/SCNScene/scene)

Creates and returns an empty scene.

[`+  sceneNamed:`](/documentation/SceneKit/SCNScene/init(named:))

Loads a scene from a file with the specified name in the app’s main bundle.

[`+  sceneNamed:inDirectory:options:`](/documentation/SceneKit/SCNScene/init(named:inDirectory:options:))

Loads a scene from a file with the specified name in a specific subdirectory of the app’s main bundle.

[`+  sceneWithURL:options:error:`](/documentation/SceneKit/SCNScene/init(url:options:)-7ugvv)

Loads a scene from the specified URL.

### Creating a Scene from a Model I/O Asset

[`+  sceneWithMDLAsset:`](/documentation/SceneKit/SCNScene/sceneWithMDLAsset:)

Creates a scene from the specified Model I/O asset.

### Managing Animated Effects in a Scene

[`paused`](/documentation/SceneKit/SCNScene/isPaused)

A Boolean value that determines whether to run actions, animations, particle systems, and physics simulations in the scene graph.

### Accessing Scene Contents

[`rootNode`](/documentation/SceneKit/SCNScene/rootNode)

The root node of the scene graph.

[`background`](/documentation/SceneKit/SCNScene/background)

A background to be rendered before the rest of the scene.

[`lightingEnvironment`](/documentation/SceneKit/SCNScene/lightingEnvironment)

A cube map texture that depicts the environment surrounding the scene’s contents, used for advanced lighting effects.

### Managing Scene Attributes

[`-  attributeForKey:`](/documentation/SceneKit/SCNScene/attribute(forKey:))

Returns the scene attribute for the specified key.

[`-  setAttribute:forKey:`](/documentation/SceneKit/SCNScene/setAttribute(_:forKey:))

Sets a scene attribute for the specified key.

[`Attribute`](/documentation/SceneKit/SCNScene/Attribute)

### Exporting a Scene File

[`-  writeToURL:options:delegate:progressHandler:`](/documentation/SceneKit/SCNScene/write(to:options:delegate:progressHandler:))

Exports the scene and its contents to a file at the specified URL.

[`SCNSceneExportDelegate`](/documentation/SceneKit/SCNSceneExportDelegate)

Methods you can implement to participate in the process of exporting a scene to a file.

### Adding Fog to a Scene

[`fogStartDistance`](/documentation/SceneKit/SCNScene/fogStartDistance)

The distance from a point of view at which the scene’s contents begin to be obscured by fog. Animatable.

[`fogEndDistance`](/documentation/SceneKit/SCNScene/fogEndDistance)

The distance from a point of view at which the scene’s contents are completely obscured by fog. Animatable.

[`fogDensityExponent`](/documentation/SceneKit/SCNScene/fogDensityExponent)

The transition curve for the fog’s intensity between its start and end distances. Animatable.

[`fogColor`](/documentation/SceneKit/SCNScene/fogColor)

The color of the fog effect to be rendered with the scene. Animatable.

### Working With Physics in the Scene

[`physicsWorld`](/documentation/SceneKit/SCNScene/physicsWorld)

The physics simulation associated with the scene.

### Working with Particle Systems in the Scene

[`-  addParticleSystem:withTransform:`](/documentation/SceneKit/SCNScene/addParticleSystem(_:transform:))

Attaches a particle system to the scene, using the specified transform.

[`particleSystems`](/documentation/SceneKit/SCNScene/particleSystems)

The particle systems attached to the scene.

[`-  removeParticleSystem:`](/documentation/SceneKit/SCNScene/removeParticleSystem(_:))

Removes a particle system attached to the scene.

[`-  removeAllParticleSystems`](/documentation/SceneKit/SCNScene/removeAllParticleSystems())

Removes any particle systems directly attached to the scene.

### Constants

[Scene Attributes](/documentation/SceneKit/scene-attributes)

Attribute keys available in the options dictionary for the methods  [`attribute(forKey:)`](/documentation/SceneKit/SCNScene/attribute(forKey:)) and [`setAttribute(_:forKey:)`](/documentation/SceneKit/SCNScene/setAttribute(_:forKey:))

[Scene Export Options](/documentation/SceneKit/scene-export-options)

Options for the [`write(to:options:delegate:progressHandler:)`](/documentation/SceneKit/SCNScene/write(to:options:delegate:progressHandler:)) method.

[`SCNSceneExportProgressHandler`](/documentation/SceneKit/SCNSceneExportProgressHandler)

The signature for the block that SceneKit calls during scene export.

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`Copyable`](/documentation/Swift/Copyable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Escapable`](/documentation/Swift/Escapable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`Equatable`](/documentation/Swift/Equatable)

[`GKSceneRootNodeType`](/documentation/GameplayKit/GKSceneRootNodeType)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)