Mesh Format Confusion

Started by
9 comments, last by cgdev 11 years ago

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?

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.

If this post or signature was helpful and/or constructive please give rep.

// C++ Video tutorials

http://www.youtube.com/watch?v=Wo60USYV9Ik

// Easy to learn 2D Game Library c++

SFML2.2 Download http://www.sfml-dev.org/download.php

SFML2.2 Tutorials http://www.sfml-dev.org/tutorials/2.2/

// Excellent 2d physics library Box2D

http://box2d.org/about/

// SFML 2 book

http://www.amazon.com/gp/product/1849696845/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1849696845&linkCode=as2&tag=gamer2creator-20

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/ )

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.

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.

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.

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.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

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.

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.

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 :).

This topic is closed to new replies.

Advertisement