Jump to content
  • Advertisement
Sign in to follow this  
DevLiquidKnight

MD3 File Format

This topic is 4084 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

One of the demos in one of my books uses the MD3 file format for the final "example" of how to produce shader effects into an engine. I noticed there are files with the extensions *.n and *.t. The *.n files are the normals and the the *.t files are used for storing tangents. These files are quite big, I was wondering, are such files standard in the MD3 file format or did this book extend them to speed things up? Why are they there, what is there purpose, and do commercial game engines typically use them?

Share this post


Link to post
Share on other sites
Advertisement
No *.n and *.t files are not part of the MD3 format. The MD3 file should contain vertex normals (although, if I remember correct, they're stored in spherical coordinates), so I'm not sure what the point of the .n file is. MD3 files don't store tangent vectors, so that's probably the reason for the .t file.

I don't know of any games that use these .n or .t files, but, of course, games do make use of normal and tangent vector do do things such as per-pixel lighting.

If the meshes are fairly complex, the author probably made these files to (as you've guessed) speed things up and avoid computing these values when the model is loaded.

Share this post


Link to post
Share on other sites
So that would mean the idea of using them in the real world is much less needed? The single data for the single model alone along with extra files required to render it excluding the binary is 132 mega bytes.

Therefore, I was really confused why anyone would need so much data to compute something otherwise games would be much larger then they are today (every creature being 132MB). The meshes are using a per-pixel lighting format to apply a form of bump mapping.

Is there an alternative way of speeding up this process without the need of .n and .t files?

Share this post


Link to post
Share on other sites
As previously said the .n and .t files store normals and tangents, tangents i can understand because it's not part of the md3 format.
Normals on the other hand is there because the MD3 format is a pretty weak format to boot, it has a single normal per vertex in spherical coordinates witch is not that useful, especially for ppl since it has such a distinct degradation of resolution, it uses only 16 bit's where i normally use 96bits.

Anyway, you still don't need tangents for ppl, you need tangents for tangent space normal mapping, it's a form of normal mapping that works well with distortions of the mesh, like if you where either using interpolated frame animations like in MD3 or want to use normal maps made for other flat surfaces.

Modern formats use some form of skeletal animation and vertex skinning to speed things up and keep the file sizes down, some of them don't even have normals since that is provided by a texture and/or can be built by the engine at load time at no real time cost (i even did it for every frame once, though that sucked).

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!