Jump to content
  • Advertisement
Sign in to follow this  
CoOlDud3

Mesh Format Confusion

This topic is 1999 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have two questions:

 

1) Which Mesh format do the professional 3D game developing companies (EA Games, Ubisoft, Rockstar Games) use?

 

2) Are there libraries available for DirectX 9, 10 and 11, to make the process of importing mesh in that widely used format easy?

Share this post


Link to post
Share on other sites
Advertisement

There isn't one mesh to rule them all, these days most companies that build a game engine roll there own or support several common formats.

 

If you need a easy to load format look into obj loader, or even IQM.  There are lots of formats to choose from. 

Share this post


Link to post
Share on other sites

Most of the big teams have their own formats, which are close to the processed ones. So they can just load the whole file into RAM and use it.

Probably, you'll just want to have a format which supports all the features you need. Also, I suggest looking into AssImp, if you need a library ( http://assimp.sourceforge.net/ )

Share this post


Link to post
Share on other sites

Usually you have two types of "formats":

 

The first category are the ones that are either built for data exchange (e.g. collada, FBX) or simply are source assets (like .obj) that can be read/written by different modeling tools. Many times those are verbose human-readable (text/XML) formats too. Generally these source assets need to be processed (triangulated...normals calculated...etc) in some manner and/or are slow to load because you're parsing XML or text rather than binary data.

 

The second category is the format that usually source assets get compiled into, and usually are binary and specific to your application/game. The idea is to do offline-compiling of source assets into this type of format so loading models at runtime would be very fast (e.g. compact binary data that is very close to the in-memory representation of your models).

 

For the Direct3D or OpenGL API's, there is no set "model format"...you're simply dealing with buffers of primitives (lines, triangles, etc), however you organize those are completely up to you. It can be as simple as each mesh piece is just a vertex buffer and an index buffer.

 

There exist libraries out there to do model importing into a general data structure that you then can translate to your own internal format, one such library that you can look at is the Assimp C/C++ library. If you're working in C#, you can take a look at the AssimpNet wrapper too.

Edited by Starnick

Share this post


Link to post
Share on other sites
There are many formats written out by modelling packages, and these are well documented with loaders available. Typically, because artists may make use of several of these on a game, they will be loaded to an intermediate format for processing. Granny 3D is one popular choice for that step, but very much not free.

After processing the mesh is written to another format, and there will be loaders for each platform the engine runs on, which may include Direct X. But that format will be very simple compared to the original, optimised for fast loading and designed to go straight to the GPU. Because every engine works differently, there is no common format for this final step.

Share this post


Link to post
Share on other sites

Create your own simple format that can be easily loaded into a vertex buffer. It's a video game, not a 3d modeling suite. There is no reason for it to support a bunch of formats and there is certainly no reason for it to be parsing textual mesh formats at runtime.

Share this post


Link to post
Share on other sites

Final formats are closely related to the engine to get the best performance out of them. As an example. .nif (NetImmerse File Format) files represent a node in the engine's scene graph. So loading is fast and simple, load file, plug in scene graph and you're good to go.

Share this post


Link to post
Share on other sites

Thank you for all the helpful details. Can you provide any good resources that could teach me the process of creating my own mesh format, and building an import library for it in DirectX?. I'll appreciate It.

Share this post


Link to post
Share on other sites

You can use d3dx library for DirectX 9. The dx11 doesn't support any file format, so you'd better define your own file format.

Share this post


Link to post
Share on other sites

Oh! You are the Alin guy who made that DirectX Exporter for 3DS Max. I've been using your exporter for a while now and I gotta say you've done a great job. But I am experiencing an issue while using it. After exporting a flat plane mesh with grass.png texture on it. When I load the mesh in my DirectX9 game. The object shows, but without the textures. Can you please guide me :). 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!