Wednesday, July 20, 2016

Texture Formats

PVRTexTool.User + Manual.pdf



1.2.1. Texture Formats

PVRTexTool offers a variety of texture compression formats depending on the user requirements, detailed below:

 PVRTC: PVRTC is PowerVR’s proprietary texture compression format. It uses a sophisticated amplitude modulation scheme to encode textures. Texture data is encoded as two low-resolution images along with a full resolution, low bit-precision modulation signal.

 ETC: Ericsson Texture Compression is a lossy texture compression scheme developed by Ericsson Research. ETC1 lacks Alpha component support, which was rectified with the release of the ETC2 scheme.

 ASTC: Adaptive Scalable Texture Compression is a lossy block-based texture compression format developed by ARM. It has been an official extension of OpenGL and OpenGL ES since 2012. The block sizes that are available range from 4x4 to 12x12 pixels for 2D textures, and 3x3x3 to 6x6x6 pixels for 3D textures, with each block being 128 bits. Therefore, the larger the block size, the smaller the size and lower the quality of the texture.

For information regarding the encoding modes associated with these formats, refer to the section on Texture Encoding.



2.4.2 Options and Settings

Multiply Colours by the Alpha Channel


Run-time optimization of a texture can be achieved by pre-multiplying the colour channels of its pixels by its alpha channels. To multiply colours by the alpha channel, use the appropriate option and click the Pre-Multiply Alpha button to complete the procedure.

What does Pre-multiplied Alpha mean?

Keyword: Premultiplied Alpha
Appendix A. Premultiplied Alpha

Premultiplied alpha is just a different way of representing alphified pixels. If the separate alpha pixel is (r, g, b, a), then the premultiplied alpha pixel is (ar, ag, ab, a).

The reason why it's interesting is that linear combinations of pixels (i.e. a1p1 + a2p2) work better in premultiplied alpha space than in separate alpha space.

For example, taking the 50/50 blend of white and transparent works like this: White is (1, 1, 1, 1) and transparent is (0, 0, 0, 0) in both spaces. So the 50/50 blend is (0.5, 0.5, 0.5, 0.5). In separated space, that's half-transparent gray, but in premultiplied space, that's half-transparent white, which is what you expect.

Linear combinations of pixels occur in a lot of contexts, including:
  1. layer compositing
  2. blurring and sharpening
  3. interpolation
  4. scaling
  5. rotation, perspective, and other transformations
and probably one or two others.

The symptom of getting alpha wrong is gray fringes when you work with transparent layers.




No comments:

Post a Comment