Sign in to follow this  
CoOlDud3

Mesh Format Confusion

Recommended Posts

CoOlDud3    151

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
EddieV223    1839

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
TheUnnamable    1129

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
Starnick    1892

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
EWClay    659
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
Chris_F    3030

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
TheChubu    9452

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
CoOlDud3    151

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
cgdev    411

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
CoOlDud3    151

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
cgdev    411


The basic export workflow is as follows:
1) Setup your scene.
2) In 3ds Max, choose File > Export from the main menu.
3) Click the "Save as type" dropdown list, and scroll to the end, where you will find Alin's DirectX Exporter.   Select the output directory and file name, and press OK. The configuration dialog will open.
4) Hit OK when you finish the configuration.

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