Sign in to follow this  
Kryogenik

Custom Model Format

Recommended Posts

I just finished a lengthy tutorial on loading .x files and animating them, only to find out from Dragonion's recent thread that .x files are old and not really used any more. Some people said it would be a good idea to make a custom model format. I need the standard stuff, like vertices (duh), materials, textures, normals, animation and if I feel like it, I might add more complicated stuff later. I have no idea how to do that though. Even more so, I don't know how to make models in my model format, is there a way I could convert other formats to it or something? Would it be worth it? I use Cinema 4d for modeling, and it can export to a decent number of formats. How would I actually read the file? I know how to use fstream to read simple files, but what about something more complicated? Thanks for any help.

Share this post


Link to post
Share on other sites
Consider using an existing file format, such as Collada, Obj, 3DS whatever suits your needs. Also, nothing speaks against the .X format if you have a working exporter and importer for it - after all, it's just your data pipeline. As long as it works, no one cares how old your file formats are.

I recommend using a library such as http://assimp.sourceforge.net to do the model loading for you.

Share this post


Link to post
Share on other sites
If you go with a custom format you will not be able to export anything into that format from anything. You will need to develop your own parser, as well as any converters you will need. The OBJ format is dead easy to parse(with many examples online), and you will learn a lot by implementing your own parser. It lacks animation, however, so a better option would be to use Collada(which i intend to do at one point myself)

Share this post


Link to post
Share on other sites
In the end, you will probably want to write your own model format.

The game specific formats (Quake, half-life, etc.) are legally questionable to use, at best. And, the interchange formats aren't optimized for game usage, so loading and processing the formats will dramatically increase the time it takes to load levels. Not to mention, you will need custom formats when you start adding space partitioning (octree, etc.) data. And, many effect systems rely on assigning special properties to vertices, faces, or materials.

Share this post


Link to post
Share on other sites
If you have to ask whether you should make a custom model format, then you don't need one. I don't mean this is in condescending way, I just mean that if you don't have any obvious ways in which your engine/game will benefit from a custom format then there's no point.

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