Import, export, and manipulate 3D models using a common infrastructure that integrates MetalKit, GLKit, and SceneKit.
SDKs
- iOS 9.0+
- macOS 10.11+
- tvOS 9.0+
Overview
The Model I/O framework provides a system-level understanding of 3D model assets and related resources. You can use this framework to import and export assets from and to a variety of industry standard file formats supported by popular authoring tools and game engines. You can also use Model I/O to generate or process model and texture data—for example, to create subdivision surfaces, to bake ambient occlusion textures, or to generate light probes. Model I/O can share data buffers with the MetalKit, GLKit, and SceneKit frameworks to help you load, process, and render 3D assets efficiently.
Model I/O Features
Importing and exporting 3D assets. A
MDLAsset
object represents a collection of objects that describe elements of a 3D scene—MDLMesh
,MDLLight
, andMDLCamera
objects. Use theMDLAsset
class to load these objects from a file or to create a collection of 3D objects for export to a file.Working with 3D model data. Use the
MDLVertex
class to inspect or rearrange a mesh’s vertex and index data format. Use classes that adopt the theDescriptor MDLMesh
andBuffer MDLMesh
protocols to minimize the number of times a mesh’s vertex and index data is copied and translated between loading, processing, and rendering on a GPU. The MetalKit and GLKit frameworks provide such classes—see MetalKit and GLKit.Buffer Allocator Processing and generating asset data. Use
MDLMesh
methods (for example, theadd
method) to process a model, generating additional data—such as surface normals, tangent basis vectors, ambient occlusion, or light maps—for use in rendering. Use theNormals(with Attribute Named: crease Threshold:) MDLTexture
class and its subclasses to generate procedural textures such as noise, normal maps, and realistic sky boxes. Use theMDLLight
class to generate light sources whose illumination is based on the contents of a scene. Use theProbe MDLVoxel
class to work with a volumetric description of a model.Array Describing realistic rendering parameters. The
MDLPhysically
class—one of many ways to describe the surface appearance for aPlausible Scattering Function MDLMaterial
object associated with a mesh—defines the intended rendering of a surface using the same physically based shading systems seen in popular feature films and high-end game engines. TheMDLPhotometric
andLight MDLPhysically
classes describe realistic lighting properties for use in rendering, and thePlausible Light MDLCamera
class also supports physically based rendering parameters.