Graphics Reference
In-Depth Information
Linear RGBA, 3
sRGB + linear A,
HDR RGB + A, 4
HDR RGBA.
6.7.1 sRGB
ASTC supports nonlinear sRGB color-space conversion both at compression and
decompression time.
To keep images in sRGB color space until the point that they are used, simply
compress them in the usual way. Then when they're loaded, instead of the regular
texture formats, use the sRGB texture formats. These are the ones that contain
SRGB8_ALPHA8 in the name. There's an sRGB equivalent of every RGBA format.
Helpfully the constants for the sRGB formats are always 0x0020 greater than
the RGBA constants, allowing an easy switch in code between the two.
As an alternative to using sRGB texture types at runtime, there is also a com-
mand line argument for the compressor to transform them to linear RGBA prior
to compression. The -srgb argument will convert the color space and compress
the texture in linear space, to be loaded with the usual RGBA texture formats.
6.7.2 HDR
ASTC also supports HDR image formats. Using these requires no additional
effort in code and the same loading function detailed above can be used. When
encoding an image in a HDR format, the encoder doesn't use HDR encoding by
default. For this, one of two arguments must be used:
forcehdr_rgb
forcehdr_rgba
In this mode, the encoder will use a HDR or LDR as appropriate on a per-block
basis. In -forcehdr_rgb mode, the alpha channel (if present) is always encoded
LDR. There are also the simpler arguments:
hdr
hdra
3 The most commonly understood and supported color space.
4 HDR RGB channels with an LDR alpha.
Search WWH ::




Custom Search