Class

MDLMaterial

A collection of material properties that together describe the intended surface appearance for rendering a 3D object.

Declaration

@interface MDLMaterial : NSObject

Overview

Each material property (a MDLMaterialProperty object) provides one specific aspect of appearance, such as opacity, shininess, or surface detail. Use the material property of a MDLSubmesh object to associate a material with a 3D object for rendering or to find the material assigned to an object loaded from an asset file.

Sets of certain material properties called scattering functions determine the material’s response to lighting. You can manage these properties together using a material’s scatteringFunction property. Creating a material with the inherited init initializer is equivalent to using the initWithName:scatteringFunction: with a MDLScatteringFunction object whose properties all have default values.

Topics

Creating a Material

+ materialWithSCNMaterial:

Creates a material object from the specified SceneKit material object.

Determining a Material’s Response to Lighting

scatteringFunction

The collection of material properties that define the material’s response to light.

Working with Individual Material Properties

- propertyNamed:

Returns the material property with the specified name.

- propertyWithSemantic:

Returns the material property for the specified material semantic.

- setProperty:

Adds a new material property to or replaces an existing material property in the material.

- removeProperty:

Removes the specified material property from the material.

- removeAllProperties

Removes all material properties from the material.

Sharing Material Properties

baseMaterial

Another material object from which this material’s properties are derived.

Accessing Material Properties with Subscript Syntax

- objectForKeyedSubscript:

Returns the material property with the specified name, for use with subscript syntax.

- objectAtIndexedSubscript:

Returns the material property at the specified index in the material, for use with subscript syntax.

count

The number of material properties in the material.

Naming a Material

name

A descriptive name for the material.

Instance Properties

Relationships

Inherits From

See Also

Materials

MDLMaterialProperty

A definition for one specific aspect of the rendering parameters for a material.

MDLScatteringFunction

A set of material properties that describes a basic shading model for materials, and the superclass for more complex shading models.

MDLPhysicallyPlausibleScatteringFunction

A set of material properties that describes a physically realistic shading model for materials.