divVerent / s2tc

S2TC - a subset of a wellknown texture compression scheme (actually Color Cell Compression)
https://github.com/divVerent/s2tc/wiki
Other
43 stars 6 forks source link

S2TC Environment Variables

Color Distance Function

The following color distance functions can be selected by setting the environment variable S2TC_COLORDIST_MODE:

The default is WAVG, which is a good compromise between speed and quality for RGB and sRGB data. For optimum quality on sRGB input, try SRGB_MIXED.

The color distance function defines how "closeness" of pixel values is judged when the pixel color values are evaluated, colors are selected, or during refinement.

Color Selection

The environment variable S2TC_RANDOM_COLORS can be set the following way:

The default is -1, which is fast but poor quality, however ideally suited for online compression. For optimum quality, try 64.

A bad color selection can later be compensated for by color refinement.

Color Refinement

The environment variable S2TC_REFINE_COLORS can be set to the following values:

The default is ALWAYS, which is fast and decent quality, and usually doesn't make things worse. For optimum quality, try LOOP.

Color refinement recalculates the color palette of a block after the pixel value decision by averaging the color values of those encoded as c0 or c1, and is a technique that helps a lot of the initial color selection was poor (e.g. if S2TC_RANDOM_COLORS was not set, or set to -1).