Sign in to follow this  
wiegje85

Collada Hell

Recommended Posts

wiegje85    151
It is official, my spirit has been broken by the inconsistency of model formats, SDKs and APIs. First I tried FBX, it had an SDK and all that and it is a pretty solid binary format, even supporting CGFX shaders. So much win, I thought. It made me cry. So I thought that Collada would be the cure to my broken spirit. This made me cry harder. From what I gather there are 3 major collada parsers out there: FCollada, ColladaDOM and OpenCollada. All 3 parsers have one thing in common: bad documentation, lack of examples and/or support. FCollada went commercial, ColladaDOM is making me cry and the "doc" folder in OpenCollada is empty. I ask all, am I doing something wrong? Or is this really the ugly truth? Are there any examples out there to get a beginner up and running using Collada? Yes I have searched the forums, but no answers. That and most threads were 3 years old and apparently Collada changes its specs every week.

Share this post


Link to post
Share on other sites
Yann L    1802
Quote:
Original post by wiegje85
I ask all, am I doing something wrong?

I think not. While I wasn't directly involved, I heard a lot of swearing from some guys at our company who were evaluating various Collada SDKs for both data import and export. AFAIK, it was eventually decided to code everything from scratch instead.

Share this post


Link to post
Share on other sites
Hodgman    51223
Yeah, I use the Horde3D engine, and they ended up writing their own collada parser from scratch too. It's apparently not too difficult if you know which parts of the spec you want to support -- the hardest part is adding in all the "special cases" when different Collada exporters do things slightly differently...

Share this post


Link to post
Share on other sites
Codeka    1239
Can I suggest assimp? I've been using it in my current project to convert from various formats (though usually Collada, since that's the format that Blender and assimp have in common) to my game's own format, and it's really great! The API is clean and obvious - so much so that I've barely glanced at the documentation.

Plus, as the assimp website says, "just because of its name, the use of Assimp will render your program sexier"

(I've got nothing to do with the assimp project, just a happy customer [smile])

Share this post


Link to post
Share on other sites
mmakrzem    1036
Just curious, what part of the FBX sdk made you cry? I started working with FBX a few years ago and I didn't find it that bad. I even made some video tutorials showing how to extract data from FBX files. I currently use FBX to load 3D models into the games that I make.

Share this post


Link to post
Share on other sites
wiegje85    151
Hi all,

Thanks for the replies. It's good to know that I'm indeed not the only one pulling his hair out over this asset issue. I'm checking out Assimp right now :)

About FBX... I hate the fact that their documentation is heavily out dated, the samples they provide don't really show anything.

I'll keep you updated ;)

Share this post


Link to post
Share on other sites
kbar    96
You could buy the collada book then use something like tinyxml to read and write your own collada files. The collada file format is quite easy to follow and the book details it quite well.

And aside from Assimp you might want to look at Irrlicht. Its a graphics engine but it supports alot of file formats and I recently, as an experiment, used it as an importer for Cinema4D to load in quake files.

[Edited by - kbar on November 7, 2009 4:16:40 AM]

Share this post


Link to post
Share on other sites
Kwizatz    1392
To me, COLLADA_DOM isn't THAT bad, though from time to time you do find that they change things and there you are chasing the documentation for the new stuff in the wiki.

The guys from Sony do frequent the DOM forums, so you can ask post your questions there and receive answers directly from the developers though.

I think the problem is inherent to the format, it just does too much, in so many different ways, and even allows for you to do things your way, no matter the API, in the end you'll end pulling your hair.

Share this post


Link to post
Share on other sites
apeternier    100
Same here. I used fbx a couple of years ago (don't remember the version, maybe was 2007). It was a bit messy, but I succesfully implemented bone animation export from a fbx file to a custom format in 2 days. Woah!

...then the night arrived.

I tried recently the new fbx release (2010 or something similar). I wanted to create a full fbx2myformat converter for everything (meshes, normals, binormals, textures, animations, etc.). I failed. I drowned in the ugly code, the poor documentation and examples. When I was looking for a functionality, it was usually so unnecessarily nested into sub-classes and spreaded into sub-methods to make me crazy. And then, after digging in the sdk headers, I found some functions with interesting names (like "getTheNormalsYouWereLookingSoHardly()" or "finallyHereTheresTheMatrixYouWereLookingFor()")... but a couple of lines before a comment was saying /* !!! DEPRECATED/TESTING METHODS, DON'T USE THEM, UNDEFINED BEHAVIOUR !!!.

Cool.

Then I tried with Collada, and discovered that it was the same fbx mess but in ascii format (btw fbx includes an ascii format as well). Poor documentation, unstandardized exporters, several format revisions, etc...

I started crying with you.

So what did I? I resurrected the previous 3dsmax plugin I wrote and updated it with the new custom format used in my engine. Fortunately 3dsmax is sold each year with a BUV (Brandnew useless version), but my original plugin code (wrote originally for 3dsmax 3!!) is *STILL* compiling exactly the same way without *ANY* change after 7/8 releases of studio max. Very good backward compatibility? Just smoke in the eyes with newer versions? Roll the dice and check the answer! :-P

Share this post


Link to post
Share on other sites
wiegje85    151
Quote:
Original post by apeternier
Same here. I used fbx a couple of years ago (don't remember the version, maybe was 2007). It was a bit messy, but I succesfully implemented bone animation export from a fbx file to a custom format in 2 days. Woah!

...then the night arrived.

I tried recently the new fbx release (2010 or something similar). I wanted to create a full fbx2myformat converter for everything (meshes, normals, binormals, textures, animations, etc.). I failed. I drowned in the ugly code, the poor documentation and examples. When I was looking for a functionality, it was usually so unnecessarily nested into sub-classes and spreaded into sub-methods to make me crazy. And then, after digging in the sdk headers, I found some functions with interesting names (like "getTheNormalsYouWereLookingSoHardly()" or "finallyHereTheresTheMatrixYouWereLookingFor()")... but a couple of lines before a comment was saying /* !!! DEPRECATED/TESTING METHODS, DON'T USE THEM, UNDEFINED BEHAVIOUR !!!.

Cool.

Then I tried with Collada, and discovered that it was the same fbx mess but in ascii format (btw fbx includes an ascii format as well). Poor documentation, unstandardized exporters, several format revisions, etc...

I started crying with you.

So what did I? I resurrected the previous 3dsmax plugin I wrote and updated it with the new custom format used in my engine. Fortunately 3dsmax is sold each year with a BUV (Brandnew useless version), but my original plugin code (wrote originally for 3dsmax 3!!) is *STILL* compiling exactly the same way without *ANY* change after 7/8 releases of studio max. Very good backward compatibility? Just smoke in the eyes with newer versions? Roll the dice and check the answer! :-P


We should be friends, considering we shared the same blood and tears. I have implemented Assimp into my engine, and .. yes of course, it does not work out of the box. Not only is the SVN version of Assimp bad (some retard commited stuff that doesn't work (forgot to declare variables needed by a function) and forgot to commit a needed header file, Thanks Assimp!!!! ._.) but it cannot import the model I have exported to Collada with the standard settings. Oh and animations aren't fully supported by Assimp's Collada importer either.

Sigh. Will it ever end?!

Share this post


Link to post
Share on other sites
Krohm    5030
I have the feeling this is going to carry over and over for a while. You know, hell's capacity is rather large and I started to feel right at home. Ever been asked of trying to keep alive the hope of having a decent DWG/DXF interoperability?

In the meanwhile, I lost the count of the various collada-related ramblings.

Share this post


Link to post
Share on other sites
wiegje85    151
This might sound crazy, but I've been known to do that from time to time.. I think it's time to create a new univeral format. Simple, fast and capable.

Anyone up for it? ;)

Share this post


Link to post
Share on other sites
Yann L    1802
Quote:
Original post by wiegje85
Sigh. Will it ever end?!

Seriously, write a reader yourself (maybe using an existing XML parser). In the end, it's going to be easier than relying on some low quality open source stuff that is going to break itself every two releases.

Oh, and there is much worse than Collada, btw. One word: IGES...

Quote:

This might sound crazy, but I've been known to do that from time to time.. I think it's time to create a new univeral format. Simple, fast and capable.

Anyone up for it? ;)

Sure ! So who is going to draft the 600 page specs, the internal virtual machine bytecode and the 256 bit IEEE format for geolocalizing each vertex position on a grid the size of our galaxy ?

Share this post


Link to post
Share on other sites
wiegje85    151
I am plowing through the Collada docs as we speak.. or type really. I think it's weird weird format, but yeah.. think I'll get used to it.

Oh and I'll write the docs, right after I actually finish this Collada thing :)

Share this post


Link to post
Share on other sites
brainydexter    158
I was in the same boat as yours sometime back :)

I ended up using collada dom and even though it seemed difficult at first, but when I had the resources around to lookup stuff, it made my life so much easier! They have good documentation, but its just scattered.

Anyways, here are some screenshots of a very simple parser and renderer I wrote for collada.

I am not sure if you are still pursuing this, but if you are; post in here and I will try to help as much as I can!

Share this post


Link to post
Share on other sites
wiegje85    151
Quote:
Original post by brainydexter
I was in the same boat as yours sometime back :)

I ended up using collada dom and even though it seemed difficult at first, but when I had the resources around to lookup stuff, it made my life so much easier! They have good documentation, but its just scattered.

Anyways, here are some screenshots of a very simple parser and renderer I wrote for collada.

I am not sure if you are still pursuing this, but if you are; post in here and I will try to help as much as I can!


Hi! I ended up using Assimp to import the Collada file and then translating it to my own two-day-old binary model format, which I am developing right now. The model format is 33 times faster to load and write than Collada is and supports all game-related features, so everything except for Lights and Cameras. It's just a bit bloated compared to FBX and all that, like the FBX version of the model is 700kb and my version is 1.1MB, it's not too amazing but still a bit bloated. The documentation for it is 2 pages long and should be self-explanatory.

Share this post


Link to post
Share on other sites
Codeka    1239
Quote:
Original post by wiegje85
Hi! I ended up using Assimp to import the Collada file and then translating it to my own two-day-old binary model format, which I am developing right now. The model format is 33 times faster to load and write than Collada is and supports all game-related features, so everything except for Lights and Cameras. It's just a bit bloated compared to FBX and all that, like the FBX version of the model is 700kb and my version is 1.1MB, it's not too amazing but still a bit bloated. The documentation for it is 2 pages long and should be self-explanatory.
Yeah, I use assimp as well and haven't had any problems. I haven't run into any of the problems that wiegje85 mentioned (it certainly compiled for me out of the box) but I haven't got into it too far just yet...

Oh and as for "bloated", you could always add a compression step to compress your files if that's an issue. Even with the cost of decompressing, it'll still be lightening fast compared to loading and parsing an XML file :-)

Share this post


Link to post
Share on other sites
wiegje85    151
Quote:
Original post by Codeka
Quote:
Original post by wiegje85
Hi! I ended up using Assimp to import the Collada file and then translating it to my own two-day-old binary model format, which I am developing right now. The model format is 33 times faster to load and write than Collada is and supports all game-related features, so everything except for Lights and Cameras. It's just a bit bloated compared to FBX and all that, like the FBX version of the model is 700kb and my version is 1.1MB, it's not too amazing but still a bit bloated. The documentation for it is 2 pages long and should be self-explanatory.
Yeah, I use assimp as well and haven't had any problems. I haven't run into any of the problems that wiegje85 mentioned (it certainly compiled for me out of the box) but I haven't got into it too far just yet...

Oh and as for "bloated", you could always add a compression step to compress your files if that's an issue. Even with the cost of decompressing, it'll still be lightening fast compared to loading and parsing an XML file :-)


I downloaded the version of their SVN and it didn't compile, when I downloaded their SDK package, everything worked just fine. I even have animation data and they said that was buggy. I just don't have bone data though. In the meantime, everything is going well!

I wanna recommend Assimp to everyone in combination with Collada!

Share this post


Link to post
Share on other sites
Porthos    210
First of all, thanks for all recommendations of Assimp :-)

Unfortunately, wiegje85 is right about at least one fact: for a few days, Assimp's SVN head was broken, but it should be fixed now ... right now, I did a clean checkout and it compiled perfectly for me, both with vc8 and vc9. I didn't check with gcc yet, however.

No missing files at least - maybe you're missing boost? - this can be avoided by using the -noboost project configs. It would be great if you could retry compiling latest SVN-Assimp. Please contact me if it still doesn't work!

And my final two cents regarding Collada: it would be a great format, but it's over-engineered by at least 3 magnitudes. I'm not sure whether the latest spec defines extensions to support Klingonian coordinate systems, but I wouldn't be surprised if they existed :-)

-- Alex


Share this post


Link to post
Share on other sites
ArKano22    650
I´m using Collada as a base format to create some kind of universal massive character asset container (dont ask because I don´t have very a very clear vision of it :P)

I wrote a collada mesh importer for my engine using DOM Collada in under 250 lines. Come on, it´s not that bad. Parsing the xml is pretty easy, i´ll agree that the documentation is pretty inexistent but you can survive looking at the headers (T_T).

Anyways, i think it would be good to write an opensource collada importer so that everyone can have at least one example to look at.

Share this post


Link to post
Share on other sites
wiegje85    151
Quote:
Original post by Porthos
First of all, thanks for all recommendations of Assimp :-)

Unfortunately, wiegje85 is right about at least one fact: for a few days, Assimp's SVN head was broken, but it should be fixed now ... right now, I did a clean checkout and it compiled perfectly for me, both with vc8 and vc9. I didn't check with gcc yet, however.

No missing files at least - maybe you're missing boost? - this can be avoided by using the -noboost project configs. It would be great if you could retry compiling latest SVN-Assimp. Please contact me if it still doesn't work!

And my final two cents regarding Collada: it would be a great format, but it's over-engineered by at least 3 magnitudes. I'm not sure whether the latest spec defines extensions to support Klingonian coordinate systems, but I wouldn't be surprised if they existed :-)

-- Alex


The missing header file was from the Assimp.NET project, however excluding that project from the solution worked just fine.

I have a question before updating to the latest version of Assimp: are there any world shocking changes made to it? I mean, will I be able to use Assimp the way I'm using it now or has the base functionality and/or structure changed?

Share this post


Link to post
Share on other sites
Porthos    210
I'm going to talk with the author of Assimp.net. However, this subproject is not required for running the Assimp library from C/C++, it's totally independent.

>> I have a question before updating to the latest version of Assimp: are there any world shocking changes made to it? I mean, will I be able to use Assimp the way I'm using it now or has the base functionality and/or structure changed?

No breaking API changes, everything should just work fine. Most of the changes since the last prebuilt package went into the Collada loader, so you might profit a lot from updating.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this