Reputation: 205
What 3D model formats are supported by ARKit? Does someone know all supported formats for using in ARKit, and which format Xcode can export to use in app?
Upvotes: 20
Views: 20926
Reputation: 58563
ARKit doesn't read any 3D formats. Only frameworks with rendering engines can do it - SceneKit and RealityKit. These two modules are satellites of ARKit, so they can read in a polygonal geometry in several popular 3D formats. If SceneKit or RealityKit can't read a file, you should convert it into USDZ
using usdzconvert Terminal command, Reality Converter, or any online converter. Here's a list of supported formats:
Collada's Digital Asset Exchange .dae
(SceneKit)
Pixar's Zipped Universal Scene Description .usdz
(SceneKit and RealityKit)
Pixar's ASCII Universal Scene Description .usda
(needs conversion)
Pixar's Binary Universal Scene Description .usd
and .usdc
(needs conversion)
Reality Composer format .rcproject
(RealityKit in Xcode 14–)
Reality Composer Pro format .realitycomposerpro
(RealityKit in Xcode 15+)
Apple's proprietary .reality
format (loads faster in RealityKit)
Wavefront Object .obj
along with material .mtl
(needs conversion)
Alembic Interchange File Format .abc
(needs conversion)
Polygon File Format .ply
(needs conversion)
Autodesk Filmbox Format .fbx
(needs conversion)
Graphics Library Transmission Format .glTF
(needs conversion)
Stereolithography File Format .stl
(needs conversion)
Native Scene Format .scn
(SceneKit)
You can use USDZ directly in SceneKit and RealityKit and moreover,
you can use it as MDLAsset
:
import RealityKit
var model = try! Entity.loadModel(named: "model.usdz")
import SceneKit
let scene = SCNScene(named: "model.usdz")!
import SceneKit.ModelIO
guard let url = Bundle.main.url(forResource: file, withExtension: "usdz")
else { fatalError() }
let mdlAsset = MDLAsset(url: url)
let scene = SCNScene(mdlAsset: mdlAsset)
Upvotes: 13
Reputation: 10876
The full set of file types documented as supported by the Model I/O framework can be found here:
https://developer.apple.com/documentation/modelio/mdlasset/1391813-canimportfileextension
The set of supported extensions and formats includes:
- .abc Alembic
- .usd, .usda, .usdc Universal Scene Description
- .usdz Universal Scene Description (Mobile)
- .ply Polygon
- .obj Wavefront Object
- .stl Standard Tessellation Language
Additional formats may be supported as well.
It looks like Apple's new preferred file type for ARKit on iOS (as of iOS 12) is their own usdz:
https://developer.apple.com/augmented-reality/quick-look/
Upvotes: 2
Reputation: 1562
DAE and OBJ/MTL are automatically supported, in the sense that you can just drop the files in the .scnassets folder and it will handle them for you. Personally, I had fewer issues with OBJ/MTL but I'm not well versed in 3D.
The documentation for Model I/O states that you can import 3D assets from the following files
The set of supported formats includes Alembic (.abc), Wavefront Object (.obj), Polygon (.ply), and Standard Tessellation Language (.stl). Additional formats may be supported as well.
I've not worked with this framework though, so can't tell you how well does it work with ARKit.
And you may want to have a look at AssimpKit which allows to export several formats to .scn SceneKit scenes
Upvotes: 17