Difference between revisions of "Making BC7 Textures"

From FreeSpace Wiki
Jump to: navigation, search
(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...")
 
m (formatting and category added)
 
Line 1: Line 1:
 
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.
 
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=
+
==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.
 
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==
  
 
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.
 
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 setting===
 
   
 
   
 
  -Quality <value>    Sets quality of encoding for BC7
 
  -Quality <value>    Sets quality of encoding for BC7
Line 15: Line 15:
 
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.
 
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==
+
===Mass conversion===
 
The tool allows you to convert whole directories at once. Great. The way it says this works is wrong though.
 
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
 
  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
Line 25: Line 25:
 
  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
 
  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==
+
===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
 
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
  
Line 32: Line 32:
 
The FF specifies that the extension of the source is going to be TGA, the fd and fx handle the destination.
 
The FF specifies that the extension of the source is going to be TGA, the fd and fx handle the destination.
  
==Modemasks==
+
===Modemasks===
 
The right settings here should improve quality. What the right settings are is TBD. References to check:
 
The right settings here should improve quality. What the right settings are is TBD. References to check:
  
Line 38: Line 38:
  
 
https://compressonator.readthedocs.io/en/latest/developer_sdk/cmp_core/index.html#mode-masks
 
https://compressonator.readthedocs.io/en/latest/developer_sdk/cmp_core/index.html#mode-masks
 +
 +
[[Category:Modding]]

Latest revision as of 00:51, 14 September 2021

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