MDL (GoldSrc)
(Redirected from Half-Life MDL)
Jump to navigation
Jump to search
![English (en) English (en)](/w/images/3/37/Flag-en.png)
![Translate (Translate) Translate (Translate)](/w/images/a/a8/Flag-Translate.png)
MDL (sometimes referred to as Half-Life MDL or HLMDL) is a model format used by GoldSrc to store dynamically lit models which can be animated using skeletal animation, along with their associated textures. It is a heavily modified version of the Quake MDL format.
Overview
Limits
HLMDL has the following limits per input SMD:
- 1 mesh
- 2048 vertices (and vertex normals) per mesh
- 4080 triangles per mesh
- 1 animation sequence
- 512 keyframes per sequence
- 128 bones
Additionally, the following limits apply to the whole MDL:
- 4 bone attachments
- 8 bone controllers
- 32 meshes across all submodels
- 256 animation sequences.
Textures must:
- Be 8-bit uncompressed BMP files.
- Have a resolution which is a multiple of 8 (multiples of 16 are preferred).
- Have a resolution which does not exceed 512x512 (soft limit; raised to 1024x1024 in
Sven Co-op and other engines like
FTE).
- Have a file name which is not longer than 64 characters (including the .bmp extension).
![Icon-Important.png](/w/images/thumb/5/5c/Icon-Important.png/10px-Icon-Important.png)
![Half-Life SDK](/w/images/thumb/6/61/Gldsrc_icon.png/16px-Gldsrc_icon.png)
![GoldSrc](/w/images/thumb/6/61/Gldsrc_icon.png/16px-Gldsrc_icon.png)
![Icon-Bug.png](/w/images/thumb/b/b4/Icon-Bug.png/10px-Icon-Bug.png)
![Tip.png](/w/images/thumb/4/45/Tip.png/9px-Tip.png)
![Warning.png](/w/images/thumb/c/cb/Warning.png/10px-Warning.png)
While the HLMDL format can handle over 100K tris, the old OpenGL renderer struggles with such "high-poly" models, even on high-end GPUs.[1]
![Note.png](/w/images/thumb/c/cc/Note.png/10px-Note.png)
![Paranoia](/w/images/thumb/a/ae/Paranoia-16px.png/16px-Paranoia-16px.png)
![Cry of Fear](/w/images/thumb/9/9d/Cof_icon.png/16px-Cof_icon.png)
![Counter-Strike Nexon](/w/images/thumb/0/08/Csnz_16px.png/16px-Csnz_16px.png)
![Sven Co-op](/w/images/thumb/1/13/Sven-16px.png/16px-Sven-16px.png)
This is obviously not a problem for games on engines much newer than
![GoldSrc](/w/images/thumb/6/61/Gldsrc_icon.png/16px-Gldsrc_icon.png)
![Codename: Loop](/w/images/thumb/1/19/Hlloop_icon.png/16px-Hlloop_icon.png)
![Unity](/w/images/thumb/1/16/Unity-256px.png/16px-Unity-256px.png)
![FreeCS](/w/images/thumb/6/65/Freecs_icon.png/16px-Freecs_icon.png)
![FTE](/w/images/thumb/4/47/Fte_icon.png/16px-Fte_icon.png)
![](/w/images/thumb/2/2e/Confirm.png/10px-Confirm.png)
![](/w/images/thumb/2/2e/Confirm.png/10px-Confirm.png)
![Cpp.png](/w/images/5/53/Cpp-16px.png)
![](/w/images/thumb/2/2e/Confirm.png/10px-Confirm.png)
Flags
Model flags
Particle effects cannot be combined, but all others can.[Clarify]
Bit | Flag name | Particle effect? | Description |
---|---|---|---|
1 | EF_ROCKET | Yes | ![]() |
2 | EF_GRENADE | Yes | ![]() |
4 | EF_GIB | Yes | ![]() |
8 | EF_ROTATE | No | Rotate this model around its origin, like the weapon pickups in ![]() |
16 | EF_TRACER | Yes | ![]() |
32 | EF_ZOMGIB | Yes | ![]() |
64 | EF_TRACER2 | Yes | ![]() |
128 | EF_TRACER3 | Yes | Like EF_GRENADE, but only has one trail |
256 | EF_NOSHADELIGHT | No | Reduces intensity of shadows on the model, without making the model flat ![]() |
512 | EF_HITBOXCOLLISIONS | No | Use hitbox for collision instead of bounding box |
1024 | EF_FORCESKYLIGHT | No | Always use skybox lighting, regardless of model location |
Texture flags
Bit | Flag name | Description |
---|---|---|
1 | STUDIO_NF_FLATSHADE | Shade the model a single tint, without any shadowing, resulting in the model looking "flat" like a cartoon character. |
2 | STUDIO_NF_CHROME | Use matcap environment mapping to render the texture as a sphere map.
![]() ![]() ![]() ![]() ![]() |
4 | STUDIO_NF_FULLBRIGHT | Display texture at maximum brightness, ignoring lighting.
![]() ![]() ![]() |
8 | STUDIO_NF_MIPMAPS | Generates mipmaps for the texture, greatly reducing texture aliasing at a distance. No effect in ![]() ![]() ![]() ![]() |
16 | STUDIO_NF_ALPHA | Unused? |
32 | STUDIO_NF_ADDITIVE | Use additive translucency. Still affected by entity lighting; use the Additive rendermode on an entity to ignore lighting.
![]() ![]() ![]() ![]() |
64 | STUDIO_NF_MASKED | Use binary alphatest transparency, wherein the last palette entry of the texture is transparent. |
In other engines
Half-Life MDLs are supported by FTE and the
Unity game
Codename: Loop.
External links
References
- From the GoldSrc Model Export Tutorial by The303:
In order to compile models with more than 4080 triangles, you must break up your SMD's into parts and give them their own $body lines for compiling. Also, FOR THE LOVE OF ALL THAT IS HOLY PLEASE DO NOT GO CRAZY ON YOUR TRIANGLE COUNT; remember this is goldsrc, not source engine. Going any higher than 9000 tris is excessive and direct ports from source/other games are inefficent, wasteful, and cause performance issues for the old renderer.— The303