Import, export, and manipulate 3D models using a common infrastructure that integrates MetalKit, GLKit, and SceneKit.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
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
MDLAssetobject represents a collection of objects that describe elements of a 3D scene—
MDLCameraobjects. Use the
MDLAssetclass 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
MDLVertexclass to inspect or rearrange a mesh’s vertex and index data format. Use classes that adopt the the
MDLMeshprotocols 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, the
addmethod) to process a model, generating additional data—such as surface normals, tangent basis vectors, ambient occlusion, or light maps—for use in rendering. Use the
Normals With Attribute Named: crease Threshold:
MDLTextureclass and its subclasses to generate procedural textures such as noise, normal maps, and realistic sky boxes. Use the
MDLLightclass to generate light sources whose illumination is based on the contents of a scene. Use the
MDLVoxelclass to work with a volumetric description of a model.
Describing realistic rendering parameters. The
MDLPhysicallyclass—one of many ways to describe the surface appearance for a
Plausible Scattering Function
MDLMaterialobject 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. The
MDLPhysicallyclasses describe realistic lighting properties for use in rendering, and the
MDLCameraclass also supports physically based rendering parameters.