MDL (Quake)

MDL (retroactively QMDL) is a file format used by to store vertex-animated models, as well as the required textures. Unlike the file formats of the same name used by and , 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 August 2019, which patch security issues with the engine, was able to load Quake MDLs, although it required a custom renderer to actually appear in-game.
== Derivatives ==
=== MD2 ===
 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 and the textures usually named some variation of and (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 ===
 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, MDLs bear little resemblance to Quake or GoldSrc MDLs.
=== MD3 ===
 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 . Like , 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 , models can use customizable materials, allowing for more control over the textures' appearance.
=== MD5 ===
 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 and files, with each mesh and animation being contained in a separate file. MD5 models do not store vertex normal information, instead relying upon normal maps to determine surface normals.
The Kex Engine remasters of and support using MD5 models instead of QMDL or MD2 models. Unlike Doom 3, these remasters use a single file for all animations. Since 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
::
* 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, 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==
* Technical documentation of the QMDL format
* Technical documentation of the MD2 format
* Technical documentation of the MD3 format
* Technical documentation of the MD3, MDC, MDS, and MDM/MDX formats
* Technical documentation of the IQM and IQE formats
* 
* - list of file formats supported by (being most of the formats listed above), including brief explanations of each model format
* - Lookup table of 162 precalculated vertex normals used by QMDL and MD2 to store vertex normals for the meshes.
** - Extended version of anorms used by MDC, containing 256 precalculated vertex normals instead of 162.
== References ==
Quake 1 models now crash the game on load · Issue #3005 · ValveSoftware/halflife
Introducing the IQM model format - Unvanquished
Category:File formats