# Mesh Optimizer

Imported clothing is often far heavier than it needs to be — duplicate vertices, messy geometry and no LODs. The **Mesh Optimizer** cleans a model up and cuts its polygon count while keeping it looking right, so your pack streams smoothly in-game.

:::hint{type="info"}
The Mesh Optimizer is a **premium** feature.
:::

## The pipeline

Optimizing a mesh runs four stages, in order:

1. **Cleanup** — removes degenerate and unused geometry.
2. **Weld** — merges duplicate/coincident vertices so the surface is continuous.
3. **QEM decimate** — reduces the triangle count using quadric error metrics, which keeps the silhouette and important detail while dropping redundant polygons.
4. **LOD generation** — builds lower-detail levels the game swaps to at distance.

The decimation is **seam- and bone-aware**, so UV borders and skinning weights are respected — the model still textures and moves correctly after optimizing.

## Before you commit

A **live before / after wireframe** lets you compare the original and the optimized result side by side. Dial the target in until you're happy with the trade-off between file size and quality **before** you apply anything.

## Applying and undoing

* Optimized meshes flow **straight into the build** and update the **live preview** immediately.
* Every optimization writes a backup (**`.optbak`**). **Restore from backup** any time to return to the original mesh.

:::hint{type="success"}
**Rule of thumb:** optimize your heaviest models (jackets, layered tops, props) first — that's where the biggest size savings are, and where LODs matter most for performance on a busy server.
:::

## Related pages

- [3D Preview](/cloth-tool/about-the-tool/3d-preview) — The centre panel renders your garment on an actual mpmfreemode01 / mpffreemode01 ped, with your real .ytd textures applied.
- [Building](/cloth-tool/about-the-tool/building) — When your project is ready, hit Build and choose the FiveM target.
- [Importing](/cloth-tool/about-the-tool/importing) — Select an item and click Import .ydd / .ytd (or right‑click an item → import).
- [Interface](/cloth-tool/about-the-tool/interface) — The main window is split into three panels.
- [Items and Textures](/cloth-tool/about-the-tool/items-and-textures) — An item is one garment or prop.
- [Texture Optimization](/cloth-tool/about-the-tool/texture-optimization) — Hand-made clothing packs are usually bloated and full of textures the game doesn't like — odd sizes, no mipmaps, wrong compression.
- [About the Tool](/cloth-tool/about-the-tool) — back to the section overview
