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


@interface SCNScene : NSObject


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.

To display your scene, you need to load it at runtime, then set it as the scene property of an SCNView:

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.


Creating a Scene from a File

+ scene

Creates and returns an empty scene.

+ sceneNamed:

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

+ sceneNamed: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:

Loads a scene from the specified URL.

Creating a Scene from a Model I/O Asset

+ sceneWithMDLAsset:

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

Managing Animated Effects in a Scene


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

Accessing Scene Contents


The root node of the scene graph.


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


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

Managing Scene Attributes

- attributeForKey:

Returns the scene attribute for the specified key.

- setAttribute:forKey:

Sets a scene attribute for the specified key.

Exporting a Scene File

- writeToURL:options:delegate:progressHandler:

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


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

Adding Fog to a Scene


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


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


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


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

Working With Physics in the Scene


The physics simulation associated with the scene.

Working with Particle Systems in the Scene

- addParticleSystem:withTransform:

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


The particle systems attached to the scene.

- removeParticleSystem:

Removes a particle system attached to the scene.

- removeAllParticleSystems

Removes any particle systems directly attached to the scene.


Scene Attributes

Attribute keys available in the options dictionary for the methods attributeForKey: and setAttribute:forKey:


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


Inherits From

Conforms To

See Also

First Steps


A view for displaying 3D SceneKit content.