Class

MDLSubmesh

A container for index buffer data and material information to be used in rendering all or part of a 3D object.

Declaration

@interface MDLSubmesh : NSObject

Overview

Submeshes are contained in MDLMesh objects, which provide vertex buffer data that a submesh’s index data refers to. Together, the vertex and index data describe the geometric form of a portion of the mesh, and the submesh’s material property determines its intended surface appearance for rendering.

Topics

Creating a Submesh

- initWithIndexBuffer:indexCount:indexType:geometryType:material:

Initializes a submesh with an index buffer and the specified properties.

- initWithName:indexBuffer:indexCount:indexType:geometryType:material:

Initializes a named submesh with an index buffer and the specified properties.

- initWithMDLSubmesh:indexType:geometryType:

Initializes a submesh by copying or converting another submesh.

Working with a Submesh’s Index Buffer

indexBuffer

An object that provides index data for the submesh.

indexCount

The number of indices in the submesh’s index buffer.

indexType

The data type for each element in the submesh’s index buffer.

geometryType

The type of geometric primitives described by the submesh’s index buffer.

topology

A description of how the non-uniform layout of the submesh’s index buffer defines the shape of the mesh.

Associating Materials with a Submesh

material

An object that describes the intended surface appearance of the submesh for rendering.

Identifying a Submesh

name

A descriptive name for the submesh.

Importing Submesh Objects from SceneKit

+ submeshWithSCNGeometryElement:bufferAllocator:

Creates a submesh from the specified SceneKit geometry element, using the specified allocator.

+ submeshWithSCNGeometryElement:

Creates a submesh from the specified SceneKit geometry element.

Constants

MDLIndexBitDepth

Options for the size of integer data in a submesh’s index buffer, used by the indexType property.

MDLGeometryType

Types of geometric primitives for rendering a submesh, used by the geometryType property.

Relationships

Inherits From

Conforms To

See Also

3D Asset Basics

MDLAsset

An indexed container for 3D objects and associated information, such as transform hierarchies, meshes, cameras, and lights.

MDLObject

The base class for objects that are part of a 3D asset, including meshes, cameras, and lights.

MDLTransform

A description of the local coordinate space transformations for a 3D object.

MDLMesh

A container for vertex buffer data to be used in rendering a 3D object.

MDLSubmeshTopology

A description of how a submesh's index buffer data is arranged and how that arrangement should be used to produce the submesh's intended 3D shape.

MDLNamed

The common interface for Model I/O objects that expose a human-readable name.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software