<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLMaterial",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLMaterial"
  },
  "title" : "MDLMaterial"
}
-->

# MDLMaterial

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

```
class MDLMaterial
```

## Overview

Each material property (a [`MDLMaterialProperty`](/documentation/ModelIO/MDLMaterialProperty) object) provides one specific aspect of appearance, such as opacity, shininess, or surface detail. Use the [`material`](/documentation/ModelIO/MDLSubmesh/material) property of a [`MDLSubmesh`](/documentation/ModelIO/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`](/documentation/ModelIO/MDLMaterial/scatteringFunction) property. Creating a material with the inherited <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/init()> initializer is equivalent to using the [`init(name:scatteringFunction:)`](/documentation/ModelIO/MDLMaterial/init(name:scatteringFunction:)) with a [`MDLScatteringFunction`](/documentation/ModelIO/MDLScatteringFunction) object whose properties all have default values.

## Topics

### Creating a material

[`-  initWithName:scatteringFunction:`](/documentation/ModelIO/MDLMaterial/init(name:scatteringFunction:))

Initializes a material

### Using a material

[`materialFace`](/documentation/ModelIO/MDLMaterial/materialFace)

The surface of an object.

[`name`](/documentation/ModelIO/MDLMaterial/name)

A descriptive name for the material.

### Determining a material’s response to lighting

[`scatteringFunction`](/documentation/ModelIO/MDLMaterial/scatteringFunction)

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

### Working with individual material properties

[`-  propertyNamed:`](/documentation/ModelIO/MDLMaterial/propertyNamed(_:))

Returns the material property with the specified name.

[`-  propertyWithSemantic:`](/documentation/ModelIO/MDLMaterial/property(with:))

Returns the material property for the specified material semantic.

[`-  propertiesWithSemantic:`](/documentation/ModelIO/MDLMaterial/properties(with:))

Returns the complete list of material properties that match the specified material semantic.

[`-  setProperty:`](/documentation/ModelIO/MDLMaterial/setProperty(_:))

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

[`-  removeProperty:`](/documentation/ModelIO/MDLMaterial/remove(_:))

Removes the specified material property from the material.

[`-  removeAllProperties`](/documentation/ModelIO/MDLMaterial/removeAllProperties())

Removes all material properties from the material.

### Sharing material properties

[`baseMaterial`](/documentation/ModelIO/MDLMaterial/base)

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

### Accessing material properties with subscript syntax

[`-  objectForKeyedSubscript:`](/documentation/ModelIO/MDLMaterial/subscript(_:)-323j3)

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

[`-  objectAtIndexedSubscript:`](/documentation/ModelIO/MDLMaterial/subscript(_:)-19j2)

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

[`count`](/documentation/ModelIO/MDLMaterial/count)

The number of material properties in the material.

### Working with textures using resolvers

[`-  loadTexturesUsingResolver:`](/documentation/ModelIO/MDLMaterial/loadTextures(using:))

Loads textures using resolver for string paths and NSURLs.

[`-  resolveTexturesWithResolver:`](/documentation/ModelIO/MDLMaterial/resolveTextures(with:))

Resolves all texture string paths as NSURLs with resolver.

## Relationships

### Conforms To

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

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

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

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

[`MDLNamed`](/documentation/ModelIO/MDLNamed)

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

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

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

### 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)