Optimizing a YTD
A texture dictionary is usually the heaviest file in a vehicle. Getting the resolution, the compression format and the mipmaps right is what separates a pack that streams cleanly from one that melts a server.
What a YTD actually is
A .ytd is a texture dictionary — a container holding every texture a model uses, each already compressed in a GPU-native format. The game does not decompress them: it uploads them to video memory as they are.
That has a direct consequence. The size of a YTD on disk is very close to the video memory it will occupy, and video memory is the resource that actually runs out. A server with two hundred vehicles, each carrying a careless 40 MB dictionary, will produce texture loss long before it produces low frame rates.
Resolution budget
Resolution is where most of the waste lives. A texture only needs enough pixels for the size it occupies on screen. A door handle rendered at forty pixels wide gains nothing from a 2048 map.
Dimensions must be powers of two — 128, 256, 512, 1024, 2048. Anything else either fails to compress or is silently rescaled.
| Name | Max size | Description |
|---|---|---|
| Main body / paint | 2048 | The one texture that justifies the largest size. 1024 is often enough. |
| Interior | 1024 | Seen up close in first person, but rarely at full screen width. |
| Wheels | 512 | Small on screen and often partly hidden behind brake calipers. |
| Glass | 256 | Mostly flat colour and reflection. Large maps are wasted here. |
| Lights | 512 | Detail matters but the surface is small. |
| Badges and small parts | 256 | Anything the player has to lean in to read. |
| Liveries | 2048 | The exception — liveries stretch across the whole body. |
| Dirt and detail maps | 512 | Tiled and blended, so low resolution is invisible. |
Compression formats
Picking the right format is the single biggest win available, and it costs nothing in quality when done correctly. An uncompressed 2048 texture takes 16 MB; the same texture in DXT1 takes 2 MB.
| Name | Memory cost | Description |
|---|---|---|
| DXT1 / BC1 | 0.5 byte per pixel | Opaque colour textures — bodywork, interior trim, wheels. No usable alpha channel. This should be your default for anything solid. |
| DXT5 / BC3 | 1 byte per pixel | Colour with a smooth alpha channel — glass, decals, liveries, anything with transparency or a gradient mask. Twice the size of DXT1, so only use it when alpha is genuinely needed. |
| ATI2 / BC5 | 1 byte per pixel | Normal maps. Stores two channels at high precision and reconstructs the third. Using DXT1 or DXT5 for a normal map produces visible blocky artefacts on curved panels. |
| A8R8G8B8 | 4 bytes per pixel | Uncompressed 32-bit. Eight times the size of DXT1. Almost never justified — if you find it in a dictionary you did not build, that alone is usually the problem. |
Mipmaps
Mipmaps are the pre-computed smaller copies of a texture that the GPU uses at distance. They add about a third to the file size and are worth every byte.
Without them the GPU samples the full-resolution texture for a car forty metres away. That looks worse — surfaces shimmer and crawl as the camera moves — and it is slower, because it thrashes the texture cache.
- Always generate a full mipmap chain, down to 1×1.
- A texture with no mipmaps is a common cause of shimmering wheels and flickering badges at distance.
- Mipmaps require power-of-two dimensions. This is the practical reason the rule exists.
A working pass over a dictionary
- 1Open the .ytd in OpenIV or CodeWalker and sort the texture list by size. The top five entries usually account for most of the file.
- 2Delete every texture the model does not reference. Leftovers from an earlier version are extremely common and cost the same as used ones.
- 3Find duplicates — the same map saved under two names. Point the material at one copy and delete the other.
- 4Check every format. Convert uncompressed textures to DXT1, or DXT5 if they carry alpha. Convert normal maps to ATI2.
- 5Halve any resolution that exceeds the budget above. Compare in-game at the distance the part is actually seen, not zoomed in on the texture.
- 6Confirm every texture has a mipmap chain.
- 7Rebuild, then check the file size. A single well-built car sits between 4 and 12 MB. Past 20 MB, something in the list above was skipped.
HD textures and the _hi model
Vehicles ship as two models: the standard model.yft and the high-detail model_hi.yft used when the camera is close. The HDTextureDist field in vehicles.meta decides at what distance the game switches.
A frequent mistake is packing high-resolution textures that are only ever seen by the _hi model into the always-loaded dictionary. Keep the heavy maps in the HD path so they are streamed only when needed, and keep the base dictionary lean.
- Do not ship a _hi model that is identical to the base model — it doubles the cost for nothing.
- Lower HDTextureDist to stop the game holding HD textures for cars that are far away.
- If a vehicle only ever appears parked in a showroom, it does not need an HD variant at all.
Checklist before shipping
- Every dimension is a power of two.
- No uncompressed A8R8G8B8 textures remain.
- Normal maps are ATI2, opaque maps are DXT1, alpha maps are DXT5.
- Every texture has mipmaps.
- No unused or duplicated textures are left in the dictionary.
- The finished .ytd is comfortably under 20 MB, ideally under 12 MB.
- Shared maps across a pack live in a parent dictionary rather than being copied.
- The vehicle has been checked in-game at close range and at distance, not just in the texture viewer.
