Sunday, October 01, 2006

The Mysterious World of 3D File Formats

This is not the sexiest 3D graphics topic but it's one that affects me every day.

I remember the first time I tried to get a model from one package into another, I think it was around 1993. I had a DXF file that came from AutoCAD. I was trying to bring that into Softimage. This ended up being a nightmare of trial and error because some stuff wasn't supported, so I had to get the file re-exported from those guys about 15 times, hack the file by hand, etc.

Fast forward 13 years later -- we're in the same boat. In trying to get some files converted from Maya to/from Softimage, I've tried 3 different converters over the last year (Collada, FBX and dotXSI), and all have their own idiosyncrasies, failings, etc. Plus, no matter which package you're using, the importers and exporters generally have very poor error reporting, so it's very hard to debug what aspect the converter is barfing on.

I have three things I want to port from 3D package to 3D package:

  1. Points in space and their related meta-data. Either it's a vert with polygon connectivity and bone weighting information, a nurbs patch, a camera with camera details, or whatever.
  2. Animation, constraints and expressions.
  3. Materials and textures.

Let's start at the bottom... surprisingly, #3 is the most reliable if you're just using a Phong or Lambert shader. It's when you get into custom shaders that this falls apart. Collada is, so far, the only format that has any kind of solution for custom shaders. It requires you to write CGFX, but it's better than nothing.

Animation generally works out -- except for the constraints and expressions part. Maybe we could all agree on a common bytecode/CodeDom type solution for being able to port expressions from package to package. I know, that's asking a lot, but given that the technology exists out there in the world already, maybe this isn't that hard.

It's the first bullet point that breaks all the time, and you'd think this would be the easiest one. Hard to believe that in 2006 we have not figured out how to perfect conversion of this from package to package.

So here's what I'd like to see: all vendors push on Collada more than any other format. Sorry, I just don't want any more custom formats like DXF, FBX or dotXSI. Right now, FBX is the best format for conversion betwen Maya and XSI, which is bad for the industry because it's proprietary and because it doesn't support all platforms (XSI Linux is not supported by FBX).

So I was kind of sad to see that Microsoft is pushing FBX with their XNA Framework instead of Collada. Microsoft are the XML kings, you'd think they'd go with an XML format, so why are they doing this? Is it because Collada started out as a Sony thing? It would really help all of us if Microsoft would just join with Sony on this one, then we could finally point 3D vendors to a single format with the requirement that they support it as their #1 conversion format.

That format should be Collada for the good of the community. We've wasted too much time on this for decades. It's time to stop screwing around.

You can read more about Collada here. Would my post be more convincing if I said that Google supports Collada? Also check out all of these videos of people using Collada.

No comments: