This article's documentation is for the "GoldSrc" engine. Click here for more information.
Quake1-16px.png
Quake2-16px.png
Quake3-16px.png

MDL (Quake)

From Valve Developer Community
(Redirected from MD3)
Jump to: navigation, search
English (en)Translate (Translate)

edit
Info icon
This page documents information about an engine not developed by Valve. This information is documented here because it has technical and/or historical relevance to Valve's engines.

MDL (retroactively QMDL) is a file format used by Quake Quake to store vertex-animated models, as well as the required textures. Unlike the file formats of the same name used by GoldSrc GoldSrc and Source Source, skeletal animation is not supported, only one texture can be used per skin, and only one mesh can be used per model. Additionally, vertices are stored as arrays of 8-bit integer values (multiplied by a 32-bit floating point scalar), causing noticeable warbling or squirming of vertices when animated, a phenomenon known as "vertex swimming". Instead of storing the exact vertex normals for each vertex, QMDL uses a stores an index which points to a lookup table of 162 indices containing vertex normal data.

Prior to engine updates in late 2020, GoldSrc GoldSrc was able to load Quake MDLs, although it required a custom renderer to actually appear in-game[1].

Icon-Bug.pngBug:Attempting to load a QMDL in current builds of GoldSrc will crash in OpenGL mode!
Older builds simply refused to render the model or load textures, both of which were circumnavigatable in single-player mods using custom renderers.  [todo tested in?]

Derivatives

MD2

Quake II Quake II uses a slightly modified version of the original Quake MDL format. Unlike its predecessor, textures are now stored as external 8-bit PCX files, although the embedded color palette is ignored. Most source ports (as well as the 2023 remaster) add support for using full-color TGAs instead of 256-color PCX. Additional "pain" skins can also be defined for monsters, and are automatically switched to (via DLL code) if the monster sustains enough damage.

Unlike Quake 1 models, Quake 2 models are almost always in their own folder, with the model usually named 🖿tris.md2 and the textures usually named some variation of 🖿skin.pcx and 🖿pain.pcx (but these naming conventions are not required).

Whereas Quake MDL stores a single scale and origin for all animations on the model, MD2 stores a separate scale and origin for each frame. This often results in MD2 models squirming more than Quake MDL, as vertex swimming can occur in an MD2 where a vertex would stay stationary in a Quake MDL.

Half-Life MDL

Main article:  MDL (GoldSrc)

GoldSrc GoldSrc uses a heavily modified version of the original Quake MDL format. Support for vertex animation is removed in favor of skeletal animation. Each texture has its own color palette, and multiple textures can be used per skin. Textures can be flagged as using certain render modes, such as alphatest transparency, additive translucency, or matcap "chrome". The vertex normals are stored as explicit values, allowing for proper sharp edges, and multiple meshes can be used per-model, including selectable "submodels". Vertex precision has been increased to floating-point as well. Tiling UVs are supported as well, unlike QMDL and MD2, although only the Sven-Coop SDK version StudioMDL can will compile them correctly.

Despite the shared file extension, Source Source 1 MDLs bear little resemblance to Quake or GoldSrc MDLs.

MD3

Quake III Quake III uses an improved version of the MD2 model format used by Quake II. While it still uses vertex animation, the vertex precision has been upgraded to 16-bit signed integer, making vertex wobbling often imperceptible except when the model is scaled up to large sizes, such as on the main screen of Wikipedia icon Return to Castle Wolfenstein. Like GoldSrc GoldSrc, multiple textures can be used per skin, a model can have several (concurrently rendered) meshes, tiling UVs are supported, and animation frame rates are stored directly in the model file. instead of using a lookup table, vertex normals are stored as explicit spherical coordinates (8-bits each for longitude and latitude; radius is omitted and unnecessary). Like Source Source, models can use customizable materials, allowing for more control over the textures' appearance.

MD5

Doom 3 Doom 3 drops vertex animation in favor of skeletal animation. Unlike its predecessors, MD5 models are not "compiled" to binary, instead being plain-text. MD5 is split into md5mesh and md5anim files, with each mesh and animation being contained in a separate file. MD5 models do not store vertex normal information[2], instead relying upon normal maps to determine surface normals.

The Kex Engine remasters of Quake Quake and Quake II Quake II support using MD5 models instead of QMDL or MD2 models. Unlike Doom 3, these remasters use a single md5anim file for all animations. Since id Tech 2 id Tech 2 does not use normal maps, implicit vertex normals are calculated by the engine at runtime by interpolating between surface normals.

Others

  • AQM (Advanced Quake Model) - ??? (used by the q2mdl editor for QMDL and MD2 models; seems to have skeletal support)
  • BMD5 - Version of MD5 format using binary data instead of plain-text; introduced in Doom 3 BFG to reduce load times for consoles
  • GLM - Raven Software's Ghoul2 Model based on MD3, to allow for skeletal animation and dismemberment in Soldier of Fortune 2 and the Star Wars: Jedi Knight games
  • MD16 - Variant of QMDL with all values upgraded to 16-bit floating point
Confirm:Does MD16 also upgrade to using explicit vertex normals, instead of a lookup table?
  • MDC - Compressed form of MD3, wherein animation frames may store vertex positions as 8-bit offsets instead of absolute 16-bit positions. Frames which are compressed this way use indexed normals, like QMDL and MD2 (but with a larger lookup table), but uncompressed frames store explicit normals in the same manner as MD3.
  • MD4 - Unfinished skeletal-animated successor to MD3 developed alongside Quake III (not included in source code release)
    • MDS - Grey Matter Studios' completed version of MD4, used in Return to Castle Wolfenstein
      • MDM/MDX - Derivative of MDS used by Wolfenstein Enemy Territory, which splits the model into separate MDM (model) and MDX (animation) files, like with MD5.
    • MDR - Raven Software's completed version of MD4, used in Star Trek Elite Force I+II
  • IQM (Inter-Quake Model) - skeletal model, supporting explicit vertex normals[2], vertex colors, and bone scaling; used as a newer alternative for MD5 in various IdTech 2+3 source ports
    • IQE (IQM Export) - plain-text version of IQM

Trivia

  • VRAD uses the same normals table as Quake MDLs for calculating the direction of bounced lighting.

External links

References

  1. Quake 1 models now crash the game on load · Issue #3005 · ValveSoftware/halflife
  2. Introducing the IQM model format - Unvanquished