Every docs URL answers with Markdown when you add .md. Site map: llms.txt
Folders to YTD
Drop folders of images and get one RDR2 texture dictionary per folder, compressed and mipmapped in your browser, packed as a RedM resource.
Per ora questa documentazione è in inglese.
Folders to YTD turns folders of images into RDR2 texture dictionaries. One folder in, one .ytd out, wrapped in a RedM resource with game 'rdr3' and a stream/ folder. Everything happens in your browser tab: nothing is uploaded and there is nothing to install.
It is the same tool as the FiveM Folders to YTD, writing RDR2 dictionaries instead of GTA V ones. The differences are listed under What is different for RDR2.
Quick start
- Press Choose a folder, or drag folders onto the page. Every folder with images in it becomes its own
.ytd. Or pick single images puts loose images into one dictionary calledtextures. - Check the names on each card: the Dictionary name at the top (that is the file name) and the texture name on every row.
- Leave Compression on Auto: BC3 with alpha, BC1 without unless you know you want something else.
- Leave Colour textures in sRGB on for model textures, and turn it off for UI sprites and icons.
- Press Build and download. You get
<resource name>.zipwith anfxmanifest.lua, aREADME.mdand the.ytdfiles instream/. - Unzip into
resources, addensure <your resource>toserver.cfgand restart the whole server.
PNG, JPG, WebP, BMP and GIF are read. Anything else in the folder is listed as left out, and so is an image the browser cannot decode.
The two names
| Name | Where it comes from | What uses it |
|---|---|---|
| Dictionary | The folder the images sit in, and the .ytd file name |
Whatever asks for the dictionary: a model’s archetype, or your own script |
| Texture | Each image file name, without the extension | The model’s shader, which asks for its texture by name |
Important
If a model wants mywall_01 and your file is called mywall01, that material draws untextured, with no warning in game. The page tells you on the row whenever a texture name differs from its file name.
Both names are lower cased, and anything that is not a letter, a number, an underscore or a dash becomes an underscore. You can edit both on the page before you build.
The build is blocked, with the reason shown, when two textures in one dictionary have the same name or two folders would write the same .ytd.
Output panel
| Option | What it does | Default |
|---|---|---|
| Compression | The format for every texture. A row can override it with its own select. | Auto: BC3 with alpha, BC1 without |
| Size | Resize to the nearest power of two, or Keep the original size. | Resize to the nearest power of two |
| Largest side | Halves an image until its longest side fits: No cap, 512, 1024, 2048 or 4096 px. | 2048 px |
| Build mipmaps | The smaller copies the game draws at a distance, down to 4 px. | on |
| High quality compression | Slower, fewer block artefacts. Turn it off for a quick look. | on |
| Set usage from the file name | Treats _n names as normal maps and _s names as specular, everything else as colour. |
on |
| Colour textures in sRGB | Stores colour textures in the sRGB form of their format, the way the game’s own model textures are stored. | on |
Each row shows what the build will do with that image: size in and out, mip levels, usage and video memory, plus a note when it had to resize or rename something.
Compression
| Format | Cost | Use it for |
|---|---|---|
| BC1 (DXT1) | 0.5 byte per pixel | Solid textures, and cut outs where every pixel is fully on or fully off |
| BC3 (DXT5) | 1 byte per pixel | Anything with alpha that fades |
| BC5 (ATI2) | 1 byte per pixel | A two channel mask |
| BC4 (ATI1) | 0.5 byte per pixel | A single channel mask |
| B8G8R8A8 | 4 bytes per pixel | Gradients and UI art where block artefacts show |
Auto picks BC3 for any image with a pixel that is not fully opaque, and BC1 for the rest. BC7 is not offered, because the page cannot encode it; BC3 costs the same memory.
Warning
BC1 keeps only one bit of alpha. A pixel is solid or gone. That is fine for a leaf or a cut out sign and wrong for glass, smoke or a soft edge. The row warns you when it sees soft alpha going into BC1.
sRGB
Leave it on for textures a model draws (walls, clothing, props). Turn it off for UI sprites and icons, which RDR2 keeps in plain (non sRGB) formats. Only colour textures are affected: normal maps, specular maps and masks are never stored as sRGB.
Size and mipmaps
Mip levels only work on sizes that are powers of two, so the default resizes each side to the nearest one (172 becomes 128, 200 becomes 256). With Keep the original size, a texture that is not a power of two is written with a single level and the row warns you, because it will sparkle at a distance. RDR2’s own textures that are not a power of two carry one level as well.
Turn Build mipmaps off only for something always drawn at one fixed size, like a UI sprite.
Download panel
| Option | What it does | Default |
|---|---|---|
| Wrap it in a resource | An fxmanifest.lua for game 'rdr3', a README and a stream/ folder. Off gives you the bare .ytd files in a zip. |
on |
| Resource name | The folder and zip name. | fivemad_textures |
The panel also counts Dictionaries, Textures and Video memory before you build.
This is the manifest the default resource gets:
fx_version 'cerulean'
game 'rdr3'
rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.'
name 'fivemad_textures'
description 'RDR2 texture dictionaries built with https://fivemad.com/redm/tools/folders-to-ytd'
version '1.0.0'
-- Everything in stream/ goes to the streamer on its own. A .ytd does not need a
-- files {} entry and it does not need a data_file line. Add this resource to
-- server.cfg with ensure, then restart the whole server: streamed assets are
-- read once at startup, so a resource restart will not pick up a new one.A .ytd in stream/ needs no files {} entry and no data_file line. Streamed files are read when the server starts, so restart myresource will not pick up a new dictionary: restart the whole server, and if the old texture still shows, clear the server cache folder and your RedM client cache.
What is different for RDR2
- The files are RDR2 dictionaries. A
.ytdfrom the FiveM version of this tool will not work in RedM, and one from here will not work in FiveM. - Formats are named the RDR2 way: BC1, BC3, BC4, BC5 and B8G8R8A8.
- The Colour textures in sRGB option exists only here.
- There is no “draw this from a script” snippet on the RedM page.
Tips
- One folder per dictionary keeps names predictable. The dictionary is always the folder the image sits in directly, not a folder further up.
- When you are replacing textures of an existing model, copy the texture names from the model exactly. Fix them in the name boxes before you build.
- Watch the Video memory total. B8G8R8A8 is eight times the size of BC1.
Limitations
- Not tried in RedM yet. The files were checked against Rockstar’s own dictionaries and read back, but nobody at fivemad has loaded one in game. If a dictionary does not show up, tell us with your RedM build number.
- It does not open existing
.ytdfiles and it cannot tell you which names a model wants. Those live in the model, not in your images. - BC7 is not written.
- Large drops are read one image at a time in the browser, so hundreds of 4K images take a while and need the memory for it.