S2TC: A Possible Workaround For The S3TC Patent Situation

Written by Michael Larabel in Software on 19 July 2011 at 01:00 AM EDT. Page 1 of 1. 105 Comments.

While S3 Texture Compression (S3TC) is widely used by many games and applications since its inclusion into OpenGL 1.3 and Microsoft DirectX 6.0, these lossy texture compression algorithms have not been implemented in the open-source Linux graphics drivers. This lack of open-source support is due to S3 Graphics holding the patent rights to this technology that they actively license to major hardware vendors. There long has been an external library that can be loaded and will work with most Mesa / Gallium3D drivers for advertising S3TC support, but it's not found by default and it's not included in leading Linux distributions due to these legal fears. There may now be a new solution for the S3TC Linux problem thanks to the advent of a new (and simpler) texture compression algorithm that can serve as a drop-in replacement.

In the past, there have been individuals that have chimed in with their own thoughts on how to workaround the S3TC patent situation for open-source drivers, but none of them have been viable in legal terms. This new possible "solution" is a brand new texture compression algorithm that is simpler than S3TC and should not be infringing upon the S3 Texture Compression intellectual property. This new work comes courtesy of the open-source developers working on the Xonotic (formerly Nexuiz) game.

Xonotic heavily depends upon texture compression and so two of the developers, Maik Merten and Rudolf Polzer, set out to do some experiments to try to come up with a free software texture compression experiment. They thought about developing their own offline texture compressor, but in the end they came up with a simple texture compression scheme that uses two colors per 4x4 pixel block (S3TC and others use two reference colors and interpolate two extra colors in-between). They have dubbed this S2TC for "Super Simple Texture Compression." This simpler scheme is "a subset of the S3TC texture compression scheme [that's] widely used." The difference is that there is no interpolation between colors and more restricted usage of the bit-stream format since the encoder is also designed to be simpler and faster. Due to these changes, the quality of S2TC is not as great as S3TC, but Maik Merten says the quality is acceptable in many cases.

Since S2TC omits key elements of the S3TC texture compression method (e.g. quantization is not done in the block encoder but within the pre-processor, no derived colors, etc), they believe -- and based upon the input of others -- that this new method is not stepping on the S3TC patent. Without the legal team of a large corporation, they are not 100% certain that the legal situation of this being a low-quality free replacement to S3TC is not certain, but they hope to see the reaction of Mesa drivers to this new development. With S2TC being a sub-set of S3TC, all modern graphics cards that can compress S3TC should also be able to support Super Simple Texture Compression in the hardware.

On this web-page they have screenshots showing off the different compression situations from the source image, using the ATI/AMD Compressonator, NVIDIA's nvcompress, the libtcx_dxtn solution for S3TC on open-source, and then the various S2TC modes. The Xonotic-S2TC developers acknowledge the quality is not as good as S3TC, but it is an open-source solution and is at least better than black textures (what happens usually when S3TC support is required by the OpenGL game/application but there is no driver support). The developers state, "A good S2TC compressor is in quality about equivalent to a bad S3TC compressor." The below example is of Xonotic with S2TC.

Hosted on GitHub is the reference S2TC implementation with an offline encoder and decoder. There is also a drop-in replacement for libtxc_dxtn (the external Mesa library for normally loading S3TC support). The Wiki page also contains descriptions of the algorithm and data format. They have also written a whitepaper on the Super Simple Texture Compression scheme.

If you enjoyed this article consider joining Phoronix Premium to view this site ad-free, multi-page articles on a single page, and other benefits. PayPal or Stripe tips are also graciously accepted. Thanks for your support.


Related Articles
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.