# Embedded or external textures for weapon models?

> Where FiveM weapon textures live: embedded in the .ydr or in a separate .ytd, how weaponarchetypes.meta links them, and fixing missing textures.

Source: https://fam-tools.com/guides/fivem-embedded-vs-external-textures · FAM Tools · published 2026-09-11 · updated 2026-09-11 · about 8 min

**Short answer.** An embedded texture dictionary lives inside the `.ydr`; an external one is a separate `.ytd`, linked to the model by the archetype’s texture dictionary name (for weapons in `weaponarchetypes.meta`, usually the same name as the model). Embedded is self-contained; external lets several models share textures and lets you swap skins without touching the model. Missing textures usually mean the model looks for a dictionary that is not streamed.

## Key points

- Embedded = textures inside the `.ydr`.
- External = a `.ytd` named in the archetype’s texture dictionary field.
- External is better for skins and shared textures.
- Vanilla weapons use external `.ytd` files (plus `+hi.ytd`).
- Pink after a move = the dictionary name no longer matches.

A weapon model can carry its textures inside itself, or point to a separate texture dictionary. Both work, and add-on packs use both — which is why moving files around sometimes turns a gun pink. Knowing where the textures actually are makes retexturing and optimising much simpler.

## The two approaches

|  | Embedded (in .ydr) | External (.ytd) |
| --- | --- | --- |
| Files | One | Two (model + dictionary) |
| Skin swaps | Re-export the model | Replace only the `.ytd` |
| Sharing textures | No | Yes — several models can use one dictionary |
| Typical use | Small props, some add-on packs | Vanilla weapons, skin packs |

## How the model finds its textures

*weaponarchetypes.meta — excerpt*

```xml
<Item type="CWeaponModelInfo__InitData">
  <modelName>w_pi_mypistol</modelName>
  <txdName>w_pi_mypistol</txdName>
  <ptfxAssetName>NULL</ptfxAssetName>
  <lodDist value="500.000000" />
</Item>
```

`txdName` names the external texture dictionary. The game loads `w_pi_mypistol.ytd` and resolves the shader’s texture names inside it; embedded textures are found inside the model first. Details in [weaponarchetypes.meta](https://fam-tools.com/guides/fivem-weaponarchetypes-meta).

## Checking what a model uses

Open the `.ydr` in CodeWalker: if it has an embedded texture dictionary, the textures are listed with the model. Otherwise, look at the shader parameters for texture names and find the `.ytd` that contains them. [Editing YTDs in CodeWalker](https://fam-tools.com/guides/codewalker-ytd-editing) covers the tools.

## Which to choose

- Selling or sharing skins: external `.ytd` — buyers replace one file.
- Attachments that share a material with the gun: external, one dictionary for all.
- A one-off prop that will never be retextured: embedded is fine.
- Never ship the same texture both embedded and external — you pay memory twice.

## Questions

### What is an embedded texture?

A texture stored inside the model file (`.ydr`) instead of a separate `.ytd` texture dictionary.

### How does a weapon model know which .ytd to use?

The `txdName` in its `weaponarchetypes.meta` entry names the texture dictionary.

### Why is my weapon pink after renaming files?

The `txdName` or the texture names no longer match the streamed `.ytd`.

### Are embedded textures faster?

Not meaningfully. External dictionaries can save memory when textures are shared.

## Related

- https://fam-tools.com/guides/codewalker-ytd-editing
- https://fam-tools.com/guides/fivem-weaponarchetypes-meta
- https://fam-tools.com/guides/ytd-texture-dictionary
- https://fam-tools.com/guides/fivem-weapon-pink-textures
