rob5300 / vtfx_reader

A tool to read the header and export images from VTFX files (xbox/ps3 source engine)
5 stars 1 forks source link
source-engine valve vtf vtfx

VTFX Reader + Image Export

Download Latest Windows EXE

GitHub Downloads (all assets, latest release)

A tool to read the header + output image resources (as png) from a VTFX file. Supports LZMA compressed resources as well as big endian formatted resources. Written in rust.

[!NOTE] Xbox 360 vtfx's usually have multiple mip levels packed into the main resource, the largest mip level will be exported.

Working texture export formats (Open issue to request):

Untested support for:

Compressed (LZMA) and non compressed images are supported. By default alpha is not exported, but can be enabled with the --export-alpha argument.

Files detected to be for the xbox 360 (v 864.8) that are in the image formats IMAGE_FORMAT_DXT1, IMAGE_FORMAT_DXT3 or IMAGE_FORMAT_DXT5 will have their endianness converted before decoding (otherwise the output will have corrupted color). PS3 files (usually v 819.8) do not need this.

How to use

Download the latest release and run via cmd/powershell/terminal using the command line arguments listed below to specify the input files and options.

e.g. ./vtfx_reader -i foo.vtf to process the file "foo.vtf" in the same folder

Usage: vtfx_reader.exe [OPTIONS] --input <INPUT>

Options:
-i, --input <INPUT>
        Input path (process single file) or folder (processes all vtf files in folder)

-o, --output <OUTPUT>
        Output folder for exported images

    --export-alpha
        If alpha should be included in image export

    --force-dxt-endian-fix
        Force apply big to little endian fix on DXT image resources (otherwise automatic)

    --no-resource-export
        Do not export any resources

    --open
        Auto open exported images

-h, --help
        Print help (see a summary with '-h')

-V, --version
        Print version

Download

Download a windows build from the latest release.

Other platforms should compile with the instructions below (linux builds may be added in future)

Compiling

To compile from source, install the rust tooling rustup, clone this project repo then use cargo run to build and run the project.

texpresso is used to decode dxt data, and lzma-rs for lzma decompression.