Contents

SCNMaterial

A set of shading attributes that define the appearance of a geometry’s surface when rendered.

Declaration

class SCNMaterial

Overview

When you create a material, you define a collection of visual attributes and their options, which you can then reuse for multiple geometries in a scene.

A material has several visual properties, each of which defines a different part of SceneKit’s lighting and shading process. Each visual property is an instance of the SCNMaterialProperty class that provides a solid color, texture, or other 2D content for that aspect of SceneKit’s rendering. The material’s lightingModel property then determines the formula SceneKit uses to combine the visual properties with the lights in the scene to produce the final color for each pixel in the rendered scene. For more details on the rendering process, see SCNMaterial.LightingModel.

You attach one or more materials to an instance of the SCNGeometry class using its firstMaterial or materials property. Multiple geometries can reference the same material. In this case, changing the attributes of the material changes the appearance of every geometry that uses it.

Topics

Creating a Material

Choosing a Shading Model

Visual Properties for Physically Based Shading

Visual Properties for Special Effects

Visual Properties for Basic Shading

Managing Opacity and Blending

Customizing Rendered Appearance

Managing Render Targets

Initializers

Instance Properties

See Also

Lighting, Cameras, and Shading