İçeriğe geç
Texture Editor

Texture Editor

How to open a .ytd or a CodeWalker .ytd.xml export, preview and replace textures, pick the compression and mips, and export a new .ytd for your stream folder.

Bu dokümanlar şimdilik İngilizce.

Open the tool Last updated

The Texture Editor opens a texture dictionary (.ytd) and lets you preview, replace, rename, add and delete its textures. PNG, JPG and WebP images are resized to a power of two and compressed right in the page, with the format and mip chain you pick, and you export a new .ytd or a CodeWalker XML + DDS zip. It is for anyone who needs to swap a logo, fix a broken texture or cut the memory of a dictionary without OpenIV.

What it is for

  • Replacing a texture. New livery, new sign, new shop logo: drop a PNG on the texture and export.
  • Fixing problem textures. Odd sizes, missing mips, uncompressed 4 MB normal maps, DXT5 with no alpha. Each texture gets a list of issues and the fix is one click.
  • Building a dictionary from scratch. Drop loose PNG or DDS files and export them as a new .ytd.
  • Checking memory. The toolbar shows the memory of the whole dictionary, each tile its own.

Everything is read and written in your browser. Nothing is uploaded.

Quick start

  1. Open the tool.
  2. Drop the .ytd from your resource’s stream folder on the page, or use Choose files or Choose folder.
  3. Click a texture tile. The big preview and the inspector below it show it.
  4. Drop a PNG, JPG, WebP or DDS on the tile or on the preview, or press Replace image.
  5. Check the result in the preview (it shows the compressed version, so what you see is what the game gets).
  6. Press Export .ytd and put the file back into stream/ with the exact same name.

Opening files

What you drop What happens
One or more .ytd files The first one opens. With several, a selector (N dictionaries in this drop) switches between them.
A folder Searched for .ytd files and CodeWalker exports.
name.ytd.xml with its DDS folder Opens the CodeWalker export. Drop the XML and the folder together, or pick the parent folder.
Loose DDS, PNG, JPG or WebP files Start a new dictionary named after the folder (or my_textures).
Images or DDS while a dictionary is open Added as new textures. A file with the same name as an existing texture replaces it.

Start empty on the first screen opens an empty dictionary called my_textures.

Game files inside an .rpf have to be extracted first with CodeWalker or OpenIV. A .ytd that is encrypted, damaged or from GTA V Enhanced (gen9) is rejected with a message; FiveM uses the legacy format.

Tip

Vehicles usually have two dictionaries: name.ytd and name+hi.ytd (the close up versions). Drop both and switch between them with the selector. Clothing has one .ytd per variation, like jbib_diff_000_a_uni.ytd.

Toolbar

Control What it does
Dictionary The dictionary name, used for the exported file names.
Used for Prop, Vehicle, Clothing / ped or Map / MLO. Guessed from the name. Changes the size warnings: 2048 px is the soft limit, 4096 for maps and MLOs.
Memory Total texture memory of the dictionary and the texture count.
Open Open another dictionary folder.
Add texture Add DDS, PNG, JPG or WebP files.
XML + DDS zip Export for CodeWalker’s Import XML.
Export .ytd Export a new .ytd.

Under the toolbar a line shows the facts of the opened .ytd (resource version, size on disk, memory pages) and after an export the same facts for the new file.

Messages appear below that: dictionary level issues (duplicate names, total size), how many textures have errors, files in the drop that are not part of the dictionary (with an Add them button), and Undo after a delete. Deleting can be undone until the next delete.

Texture grid

Filter textures searches names and usages. Sort by File order, Name, Memory or Pixels.

Each tile shows a thumbnail, the name, size and format, the usage and the memory. A red or amber badge counts the errors and warnings (hover it to read them). Edited tiles show their state in green: Replaced, Added, Re-encoded or Mips rebuilt. A tile without a DDS says No DDS. Drop an image on any tile to replace that texture.

Preview

Control What it does
RGB Colour, alpha ignored.
RGBA Colour over the backdrop using alpha.
R, G, B, A Single channels. A is the fastest way to check a cutout or decal mask.
Backdrop Checker, black, grey or white, used by the RGBA view.
Zoom Mouse wheel, the zoom buttons, the percentage (click for 1:1) and fit to view.
Mip level Shows each mip, for example Mip 2: 256x256, when the texture has more than one.

You can drop an image on the preview to replace the selected texture.

Inspector

The top row has the Name (rename it, two textures can not share a name), the Usage (DIFFUSE, NORMAL, SPECULAR, DETAIL, EMISSIVE, TINTPALETTE, DEFAULT, UNKNOWN), Revert (back to the file you opened) and Delete.

The facts: size, format, mips (for example 9 of 9), memory, alpha (opaque, cutout, soft), flags, source file and encode time. Below them the issue list for this texture.

Issues it checks

  • Name has spaces.
  • Size is not a power of two.
  • Bigger than 4096 (error) or bigger than the limit for the Used for type (warning).
  • Fewer mip levels than the game wants.
  • Large uncompressed textures.
  • Normal maps in DXT1 or ATI2 (notes), colour maps in ATI1 or ATI2 (warning).
  • DXT5 with fully opaque alpha (DXT1 would halve the memory).
  • Soft alpha stored as DXT1 (it becomes on or off).
  • A DDS missing, truncated or in an unknown format.
  • For XML exports: when the XML and the DDS file disagree on size, mips or format (the DDS wins).

Dictionary wide it warns about duplicate names and the total size: a note above 8 MB, a warning above 16 MiB (FXServer prints a memory warning) and an error above 48 MiB (FXServer calls the file oversized).

Actions

  • Replace image picks a new file for the selected texture.
  • Re-encode as … encodes the texture again with the settings below (for example to turn DXT5 into DXT1 or downsize it).
  • Build missing mips appears when the texture has fewer mips than the game wants. The full size level stays exactly as it was.
  • DDS and PNG download the selected texture.

Encode settings

These apply when you replace, add or re-encode a texture.

Setting Options Default
Format Keep, DXT1 (BC1), DXT5 (BC3), ATI2 (BC5), ATI1 (BC4), A8R8G8B8 Keep
Size Same, Nearest power of two, 4096, 2048, 1024, 512, 256, 128, 64 Same
Fit Stretch, Fit (pad) (pads with transparency), Crop (fill) Stretch
Max size 4096, 2048, 1024, 512, 256 2048
Mips Game (to 4 px), Full (to 1 px), None Game
Mip filter Kaiser, Box Kaiser
Quality High, Fast High

Will cost shows the memory and the size the texture will have with these settings.

How the settings play together:

  • Keep reuses the format of the texture you replace. When that format can not be written (for example DXT3 or BC7), it picks DXT5 for normal maps and textures with soft alpha, DXT1 for the rest.
  • Same keeps the size of the texture you replace, so UVs and the rest of the dictionary stay as they were. For brand new textures it falls back to the nearest power of two.
  • The result is always a power of two and never bigger than Max size.
  • A DDS you drop is used as it is, without re-encoding.
  • Re-encoding a texture that is already compressed loses a little detail. Use the original artwork when you have it.

Which format to pick

Format Memory Use it for
DXT1 0.5 byte per pixel Most diffuse, spec and normal maps without alpha. Cutout alpha (fences, leaves) works too, it is on or off.
DXT5 1 byte per pixel Soft alpha: glass, decals, hair, fades. Cleaner normal maps at twice the cost.
ATI2 (BC5) 1 byte per pixel Two channel data. Stores only X and Y of a normal, test in game before you ship it.
ATI1 (BC4) 0.5 byte per pixel One channel masks.
A8R8G8B8 4 bytes per pixel Only when compression artifacts are not acceptable, like small UI or script render targets.

BC7 textures are shown and written back untouched. The editor does not encode BC7; re-encoding one turns it into one of the formats above.

Output

Button File Contents
Export .ytd <dictionary>.ytd Every texture that has a DDS. Name, usage and flags you did not touch stay as they were.
XML + DDS zip <dictionary>.zip <dictionary>.ytd.xml and a folder <dictionary>/ with one DDS per texture, the layout CodeWalker’s Import XML wants.
DDS, PNG <texture>.dds, <texture>.png The selected texture only.

Textures without a DDS are left out of both exports; the message lists them. Wait until every texture has finished encoding before you export, the tool tells you if some are still busy.

Put it back into the game

  1. Export .ytd and copy the file into your resource’s stream folder with the exact same name as the one you replace.
  2. Restart the resource (or the server). Players download the new file when they join.
  3. Going through CodeWalker instead: extract the XML + DDS zip, then Import XML in the RPF Explorer and pick the .ytd.xml.
Terminal
my_car/
  fxmanifest.lua
  stream/
    mycar.yft
    mycar.ytd        # the rebuilt dictionary
    mycar+hi.ytd
fxmanifest.lua
fx_version 'cerulean'
game 'gta5'

FiveM streams everything in stream/ automatically, so a .ytd needs no files or data_file entry. For clothing, keep the file names your addon pack uses.

Important

Texture names inside the dictionary are what shaders look up. If you rename a texture, the model will not find it any more unless its shader points at the new name too.

Texture memory and server warnings

The memory numbers are the GPU size of the texture with its mips, the same number the game streams. A .ytd file on disk is smaller because resources are compressed, but in memory it is the full size. FXServer prints a memory warning for every streamed file above 16 MiB of physical memory and calls it oversized above 48 MiB, and players on weaker PCs get textures that pop in late or stay blurry. The usual fixes, biggest win first:

  • Drop 4096 textures to 2048 and 2048 ones to 1024 where nobody looks closely. Each step cuts the memory by 4.
  • Use DXT1 instead of DXT5 when the alpha is fully opaque (the inspector tells you when that is the case). Half the memory.
  • Never ship A8R8G8B8 for normal textures, it is 8x DXT1.
  • Keep full mip chains. Without mips the game always keeps the biggest level loaded and the texture shimmers at distance.
  • Split a huge dictionary: shared textures in one .ytd, or move close up detail into the +hi dictionary for vehicles.

For many files at once, use the YTD Optimizer.

Common mistakes

  • Wrong file name. The exported .ytd is named after the Dictionary field. Make sure it matches the file you replace, including +hi.
  • Soft alpha in DXT1. Glass or decals turn hard edged. Pick DXT5, or leave Format on Keep when the original was DXT5.
  • Stretching a wide logo. Set Fit to Fit (pad) or Crop (fill) when your image has a different aspect ratio than the texture.
  • Exporting while encoding. Wait for the busy labels on the tiles to finish.

Limitations

  • Does not encode BC7 or DXT3. Those stay untouched unless you re-encode them into another format.
  • Reads the legacy .ytd format FiveM uses, not GTA V Enhanced files.
  • Encrypted files (for example escrow protected assets) can not be opened.
  • Everything runs in your browser and nothing is uploaded.