Import, export, and manipulate 3D models using a common infrastructure that integrates MetalKit, GLKit, and SceneKit.
Language
- Swift
- Objective-C
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, bake ambient occlusion textures, or 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
MDLAssetobject represents a collection of objects that describe elements of a 3D scene—MDLMesh,MDLLight, andMDLCameraobjects. Use theMDLAssetclass 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
MDLVertexDescriptorclass to inspect or rearrange a mesh’s vertex and index data format. Use classes that adopt the theMDLMeshBufferandMDLMeshBufferAllocatorprotocols 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.Processing and generating asset data. Use
MDLMeshmethods (for example, theaddNormals(withAttributeNamed:creaseThreshold:)method) to process a model, generating additional data for use in rendering—surface normals, tangent basis vectors, ambient occlusion, or light maps. Use theMDLTextureclass and its subclasses to generate procedural textures such as noise, normal maps, and realistic sky boxes. Use theMDLLightProbeclass to generate light sources whose illumination is based on the contents of a scene. Use theMDLVoxelArrayclass to work with a volumetric description of a model.Describing realistic rendering parameters. The
MDLPhysicallyPlausibleScatteringFunctionclass—one of many ways to describe the surface appearance for aMDLMaterialobject 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. TheMDLPhotometricLightandMDLPhysicallyPlausibleLightclasses describe realistic lighting properties for use in rendering, and theMDLCameraclass also supports physically based rendering parameters.