Skip to content
RED+
Contents

Meshes

Fix Texture Alpha

Fix Texture Alpha cleans the cut-out textures of a mesh, such as palm fronds, gratings and fences. Texels less than half opaque add little to the picture, yet they still hide whatever is drawn behind them, so parts of the mesh erase each other in game. Fix Texture Alpha makes those texels fully transparent in the texture file.

Where to find it

In Mesh Properties, click Fix Texture Alpha. It works on the mesh named in the Mesh File field.

How to use it

  1. Open the mesh object's properties (Edit, Properties..., Ctrl+P).
  2. Click Fix Texture Alpha.
  3. Read the report. It lists every texture the mesh uses and what will happen to each.
  4. Click Yes to go ahead, or No to change nothing.
  5. RED+ then runs Reload Textures and Reload Meshes. Reload Textures reads again only textures that had failed to load, so a texture the editor has already loaded keeps showing its old image until you restart the editor.
  6. Pack the level again to ship the corrected textures. A level packed earlier still carries the old texture until you pack it again.

What it changes

  • Only the alpha channel. Texels with an alpha of 1 to 127 become 0, fully transparent. Texels at 128 or above are left as they are.
  • Colours are never changed.
  • The edges of the cut-out become slightly harder.
  • The mesh file is not changed, only its textures.
  • A run-length compressed .tga is saved uncompressed.

Because the fix is in the texture, the result looks the same in stock Red Faction, Dash Faction and Alpine Faction.

Which copy it edits

The same texture name can exist in several folders. Fix Texture Alpha edits the copy the editor actually loads: the one in user_maps\textures, in a folder inside it, or in red\textures. Other copies of the same name that nothing loads, such as one next to the mesh in user_maps\meshes, are listed in the report and left alone.

The report also tells you whether the game will see the file it edits:

Where the edited copy isWhat to know
user_maps\texturesThe game sees it.
A folder inside user_maps\texturesThe editor sees it now. The game sees it once the level is packed.
A folder inside user_maps\textures, with another copy in user_maps\textures itselfThe packer ships the other copy, which is not edited. Copy the fixed file over it afterwards.
red\texturesThe packer does not look there.

Backups

Before it changes a texture, RED+ copies it to the same name with .bak added, for example frond.tga.bak. An existing backup is never overwritten, so it always holds the texture as it was before the first fix. If the backup cannot be made, the texture is not changed.

What the report says

Each texture gets one line:

  • FIX: the texture has texels below half opacity that still hide what is behind them. The line gives how many, and what share of the image they are.
  • ok: the texture is already clean.
  • skip: the texture is left alone, for one of these reasons:
    • It is genuinely see-through, like glass or a fade. A cut-out texture is almost all fully clear or fully solid. A texture with less than 80 % of its texels at alpha 0 or 255 is treated as see-through, because clearing it would delete it.
    • It has no alpha channel to clean. Only 32-bit .tga files are edited.
    • A .atx, .dds, .png, .jpg or .jpeg file of the same name, found anywhere except a folder inside user_maps\textures (for example in user_maps\textures itself or in a packfile), replaces the .tga, so the editor and the game draw that file instead. See Which texture file RED+ uses.
    • It is inside a packfile, it is not found where the editor looks for textures, or it is in a folder the tool does not edit.
    • It could not be read.

If nothing needs fixing, the report says Nothing to fix on this mesh. and nothing is changed.

Limits

  • The mesh must be a loose file. If it is inside a packfile, extract the mesh into user_maps\meshes and its textures into user_maps\textures first.
  • If the Mesh File field is empty, it asks you to pick a mesh file first.

Good to know