Class

MDLSubmesh

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

Declaration

class 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

Working with a Submesh’s Index Buffer

var indexBuffer: MDLMeshBuffer

An object that provides index data for the submesh.

var indexCount: Int

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

var indexType: MDLIndexBitDepth

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

var geometryType: MDLGeometryType

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

var topology: MDLSubmeshTopology?

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

var material: MDLMaterial?

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

Identifying a Submesh

var name: String

A descriptive name for the submesh.

Importing Submesh Objects from SceneKit

init(scnGeometryElement: SCNGeometryElement, bufferAllocator: MDLMeshBufferAllocator?)

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

init(scnGeometryElement: SCNGeometryElement)

Creates a submesh from the specified SceneKit geometry element.

Constants

enum MDLIndexBitDepth

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

enum MDLGeometryType

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

Relationships

Inherits From

See Also

3D Asset Basics

class MDLAsset

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

class MDLObject

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

class MDLTransform

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

class MDLMesh

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

class 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.

protocol MDLNamed

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