Making BC7 Textures

From FreeSpace Wiki
Revision as of 03:25, 13 September 2021 by EatThePath (talk | contribs) (Created page with "Figuring out how to make good BC7 textures has enough pitfalls that notes need to be recorded for my future reference and for others. Priority is given to getting the notes wr...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Figuring out how to make good BC7 textures has enough pitfalls that notes need to be recorded for my future reference and for others. Priority is given to getting the notes written, not to organization. Feel free to make this page nicer so long as you don't lose any information. And if you have new findings, add them.

Intermediate formats

PNG is a popular format to transfer textures between programs. Unfortunately many FSO maps require transparent or nearly transparent sections of texture, and programs can often drop color information in these areas, destroying information FSO needs. TGA is a potential alternative format.

CompressonatorCLI

CompressonatorCLI is a tool that lets you have actual control over the BC7 options in detail. It also sucks at fully documenting that control. Clarifications I've needed to dig out go here.

Quality setting

-Quality <value>     Sets quality of encoding for BC7

Digging into their example files yields a claim that 1.0 is max quality and 0.0 is the minimum. It also claims 1.0 is the default, but it probably wouldn't hurt to specify it anyway, just in case.

Mass conversion

The tool allows you to convert whole directories at once. Great. The way it says this works is wrong though.

the suggested syntax for doing patch conversions is  ./source_dir/ ./dist_dir/ which doesn't do diddly. ./s ./d gets you a little closer, it actually finds the source files then, but it fails completely and silently at saving them. Except not actually, because while ./ is the working directory for the source, it's the drive root for the dest, so it's saving them in there
even better
I'm working in D:\compress\bin\CLI
with a dc_in and a dc_out dir, and to get the conversion working properly I have to use this mess:
.\dc_in D:\compress\bin\cli\dc_out\d\
this creates the dc_out\d directory, but puts everything in \dc_out
now if I'm doing specific files, it works more or less as designed. .\dc_in\Sath_02.dds .\dc_out\Sath_02.tga does what it should

Mass convert to TGA

If bulk converting *from* DDS it's poorly documented how to specify a format to decode to. This is how I get it to decode TGA

-fd ARGB_8888 -ff DDS -fx TGA

The FF specifies that the extension of the source is going to be TGA, the fd and fx handle the destination.

Modemasks

The right settings here should improve quality. What the right settings are is TBD. References to check:

https://docs.microsoft.com/en-us/windows/win32/direct3d11/bc7-format-mode-reference

https://compressonator.readthedocs.io/en/latest/developer_sdk/cmp_core/index.html#mode-masks