10.02.2014 Views

spec - OpenGL

spec - OpenGL

spec - OpenGL

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C.2. BPTC COMPRESSED TEXTURE IMAGE FORMATS 596<br />

Interpolation is always performed using a 6-bit interpolation factor. The effective<br />

interpolation factors for 2, 3, and 4 bit indices are given below:<br />

2 0, 21, 43, 64<br />

3 0, 9, 18, 27, 37, 46, 55, 64<br />

4 0, 4, 9, 13, 17, 21, 26, 30, 34, 38, 43, 47, 51, 55, 60, 64<br />

The interpolation results in an RGBA color. If rotation bits are present, this<br />

color is remapped according to:<br />

0 no change<br />

1 swap(a,r)<br />

2 swap(a,g)<br />

3 swap(a,b)<br />

These 8-bit values show up in the shader interpreted as either RGBA8<br />

or SRGB8_ALPHA8 for COMPRESSED_RGBA_BPTC_UNORM and COMPRESSED_-<br />

SRGB_ALPHA_BPTC_UNORM re<strong>spec</strong>tively.<br />

C.2.2 Formats COMPRESSED_RGB_BPTC_SIGNED_FLOAT and<br />

COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT<br />

Each 4×4 block of texels consists of 128 bits of RGB data. These formats are very<br />

similar and will be described together. In the description and pseudocode below,<br />

signed will be used as a condition which is true for the SIGNED format and false<br />

for the UNSIGNED format. Both formats only contain RGB data, so the returned<br />

alpha value is 1.0. If a block uses a reserved or invalid encoding, the return value<br />

is (0, 0, 0, 1).<br />

Each block can contain data in one of 14 modes. The mode number is encoded<br />

in either the low two bits or the low five bits. If the low two bits are less than<br />

two, that is the mode number, otherwise the low five bits the mode number. Mode<br />

numbers not listed in table C.7 are reserved (19, 23, 27, and 31).<br />

The data for the compressed blocks is stored in a different format for each<br />

mode. The formats are <strong>spec</strong>ified in table C.8. The format strings are intended to<br />

be read from left to right with the LSB on the left. Each element is of the form<br />

v[a : b]. If a ≥ b, this indicates extracting b − a + 1 bits from the block at that<br />

location and put them in the corresponding bits of the variable v. If a < b, then<br />

<strong>OpenGL</strong> 4.2 (Compatibility Profile) - August 22, 2011

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!