14

I read several tutorials how to place 3d objects in SceneKit/ARKit applications and all of them uses .scn format files for the objects.

But I found there is no any issues if I use original .dae format and do not convert it to .scn format.

I don't really see any difference between .dae and .scn formats.

Actually result seems to me the same but can you explain what the difference between them and what I should use in what cases?

Thank you!

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
wm.p1us
  • 2,019
  • 2
  • 27
  • 38

2 Answers2

17

Differences in 2023

The difference between .dae and .scn formats is notable. Collada .dae file (which stands for digital asset exchange) is a cross-platform XML-based schema format used for graphics and visual effects in 3D authoring apps, like Maya or Blender. SceneKit's .scn is Xcode's native file format, which works in iOS and macOS apps. Unfortunately, scene's complexity and hierarchical structure aren’t the .dae and .scn formats’ strong sides. So, the most robust and effective up-to-date 3D file format that you can use in SceneKit and RealityKit is a USDZ format.

USD family is Universal Scene Description formats, developed by Pixar. They are a cross-platform Python-based schema files that have the ability to create 3D scenes by composing many sources files together into successively larger aggregations.

SceneKit file formats

SceneKit supports many popular 3D formats. Geometry kept in those formats is visible through ARSCNView, SCNView and SwiftUI's SceneView.

  • Collada's Digital Asset Exchange .dae

  • Pixar's Zipped Universal Scene Description .usdz

  • Pixar's ASCII Universal Scene Description .usda

  • Pixar's Binary Universal Scene Description .usd, .usdc

  • Wavefront Object .obj along with its material description .mtl

  • Alembic interchange file format .abc

  • Polygon file format .ply

  • Stereolithography file format .stl

  • Apple proprietary SceneKit Scene format .scn

  • To convert .fbx and .glTF files into .usdz use command line.

RealityKit file formats

Since 2019, the RealityKit framework has been gaining popularity in iOS, macOS and visionOS development. It works with the following 3D file formats, supporting realistic materials, physics, animation and spatial sound. Geometry kept in those formats is visible through ARView, RealityView and Model3D view.

  • Pixar's Zipped Universal Scene Description .usdz (read about unzip process here)

  • Reality Composer's multi-scene hierarchy .rcproject (Xcode 14–)

  • Reality Composer Pro's multi-scene hierarchy .realitycomposerpro (Xcode 15+)

  • Apple proprietary format (has much faster uploading time) .reality


Read about Reality Composer's .rcproject and .reality formats here.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
  • Thanks Andy. How did you get by the .usd_ Pixar import information? I don't see this specified in Xcode 12's SCNSceneSource documentation. I will try it with a Blender export one day. – axello Oct 06 '20 at 07:35
  • Hi @axello! Do you have any issues when exporting `usd` or converting `usdz`? Or you just need a reference to info. – Andy Jazz Oct 06 '20 at 07:38
  • Hi Andy, thanks for the offered help. I come 'from the other side'; Xcode. Just learning Fusion360 and now Blender. I found the export to usdc functionality in Blender, and see that Xcode shows it fine. Just wondering why Apple did not bother to update their SceneKit documentation. Can't be a lack of funds :-) I *do* am struggling still to figure out how to access the exported animation nodes in this cube from swift... https://sketchfab.com/3d-models/rubiks-cube-4cc7c1bf585f4b929ddd32f6cab3ba58 – axello Oct 07 '20 at 20:46
  • Hi @axello. I think Apple doesn't bother about updating SceneKit documentation because there is a new favourite – RealityKit. Seems it can be SceneKit's replace. – Andy Jazz Oct 07 '20 at 22:24
  • 1
    Thanks again Andy! I should watch some *newer* AR-VR-Scene-Reality-Kit wwdc videos! I've been stuck in the past. I will look into RealityKit. – axello Oct 09 '20 at 09:47
12

DAE (Digital Asset Exchange, aka Collada) is a vendor-neutral format for 3D assets. It supports a wide range of features that exist in multiple 3D authoring and presentation tools, but not every possible feature in SceneKit. Historically, it was the only asset format for early versions of SceneKit.

SCN format is a serialization of the SceneKit object graph. (There are convenience methods for reading/writing it on SCNScene, but really it's the same thing you get by passing an SCNScene to NSKeyedArchiver/NSKeyedUnarchiver.) Thus, it by definition supports all features of SceneKit, including physics, constraints, actions, physically based cameras, and shader modifiers.

If you're using DAE assets, deploying to iOS (or tvOS or watchOS), and not seeing any difference vs using SCN assets, there are two possible reasons:

  • Your assets use only those SceneKit features that are available in DAE format.
  • When deploying to iOS/tvOS/watchOS, Xcode (via scntool) automatically converts all 3D asset resources to SCN format. (And applies other transformations, like interleaving geometry buffers, for optimal rendering performance on iOS/tvOS/watchOS devices.) The filename in the built app's Resources directory still has a .dae extension, but the file contents are the same as SCN format.

    (SceneKit running in iOS/tvOS/watchOS actually can't read DAE, so it relies on this preprocessing by Xcode.)

rickster
  • 124,678
  • 26
  • 272
  • 326