As more and more hardware and software graphics platforms support texture mapping, the scenes that people would like to render have grown much more complex, making greater use of textures. One of the costs of texture mapping is that the texture images often require a large amount of memory. Memory for textures can be limited, especially in hardware rendering systems where textures are placed in a dedicated memory in the graphics subsystem. We can fit more texture data into available memory be compressing the textures.
Our approach uses vector quantization (VQ) to compress the textures. In a VQ-compressed image, each block of pixels (for example, 4x4 pixels) is represented by a block of pixels selected from a small set of representative blocks. This set of representative blocks is created during the compression or encoding process, and is called a codebook. The image is then represented as a set of indices into this codebook, and is called an index map. A higher quality compressed image is achieved by using more codewords in the codebook, or encoding the image using smaller blocks. The storage cost of a larger codebook can be amortized over many images by creating a shared codebook that contains representative blocks for many images.
We can extend this method to handle mipmaps by making the following observation: Given an image that is compressed using 4x4 codewords, we can create a compressed image that is half the width and height by averaging each of the 4x4 codewords down to 2x2 codewords. Applying this idea again, we can make an image that is one quarter the size by averaging the 2x2 codewords down to 1x1 codewords.
Using this method, we have observed compression rates of up to 35:1 at acceptable quality loss. In an implementation of this method in a software renderer, the rendering times were increased by between two and twenty percent, depending on the number of bits in the indices and whether or not mipmapping was performed. With very little hardware support, we suspect even this small increase in time can be made negligible.
|The images to the left are from an SGI demo called Performer Town. The database contains 5MB of textures (4MB color textures, the rest RGBA or intensity-only textures). In this case, one codebook was generated for all color textures, one for RGBA textures, and one for intensity textures. Here we have compressed the color textures using a 4096 entry codebook of 4x4 codewords. The overall compression rate is 15.3:1.
|In this case, the color textures were separated into three groups: road textures, sign textures, and everything else. Hopefully, the textures in each group would have a higher chance of having common codewords, and thus be representable by a smaller set of codewords. Here, the signs are compressed using 256 2x2 codewords, and the roads using 256 2x2 codewords, and the remaining textures using 4096 4x4 codewords for each. The overall compression rate is 12.7:1.
|In this case, the color textures are separated into the same groups as in the previous case, but we've designed smaller codebooks for each of the groups. Here, the signs are compressed using 256 2x2 codewords, and the roads and the remaining textures are compressed using 256 4x4 codewords for each.