[Mesa-dev] S2TC - yet another attempt to solve the "S3TC issue"
Rudolf Polzer
divverent at xonotic.org
Wed Aug 10 03:07:05 PDT 2011
On Wed, Aug 10, 2011 at 11:46:00AM +0200, Philipp Klaus Krause wrote:
> Am 10.08.2011 08:50, schrieb Marek Olšák:
> > The problem is there is no adoption of S2TC in the industry. The
> > current state is that Unigine products don't run without full S3TC.
> > Neither does the id Tech 4 engine. Most, if not all, D3D games
> > consider S3TC a standard. In order to succeed, S2TC must become a
> > standard too.
>
> Which would take so much time, it wouldn't make sense - by then all
> hardware probably supports BPTC, since it is required by OpenGL 4.2.
> AFAIK BPTX most of the time provides better quality than S3TC, and thus
> better quality than S2TC.
Right. Plus, I doubt the ARB would accept an extension that is a subset of an
already existing extension, and even temporary.
Which is why I would rather suggest Mesa to design and implement a S2TC
extension spec that tries to be as compatible as possible to S3TC. The general
idea is that an existing game engine should only require minimal changes to use
S2TC, and have S3TC decode S2TC easily too.
The one big problem could be the texture format identifier. If the S2TC
extension is to use
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
this would minimize changes to the software affected - all that changes, is
that S2TC supporting software would test BOTH extension strings.
However, then S3TC-expecting software that uses GL_ARB_texture_compression and
enumerates texture formats would still find GL_COMPRESSED_RGBA_S3TC_DXT1_EXT in
the list, and expect full S3TC decoding. So likely, a different texture format
identifier would be required.
Also, this would require both compression and "upload" (e.g. shader decompression)
in Mesa, as this should serve as full replacement for
GL_EXT_texture_compression_s3tc.
If we use a different identifier for the texture format, which we'd likely have
to, an application would need to be changed to support S2TC like this:
Change initialization code from:
- check for GL_EXT_texture_compression_s3tc
- if available, set s3tc_supported = 1
to
- check for GL_EXT_texture_compression_s3tc; if available:
- set s3tc_supported = 1 and s2tc_supported = 1
- set S2TC_DXT1 = GL_COMPRESSED_RGB_S3TC_DXT1_EXT
- set S2TC_DXT1A = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
- set S2TC_DXT3 = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
- set S2TC_DXT5 = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
- otherwise, check for GL_MESA_texture_compression_s2tc; if available:
- set s3tc_supported = 0 and s2tc_supported = 1
- set S2TC_DXT1 = GL_COMPRESSED_RGB_S2TC_DXT1_MESA
- set S2TC_DXT1A = GL_COMPRESSED_RGBA_S2TC_DXT1_MESA
- set S2TC_DXT3 = GL_COMPRESSED_RGBA_S2TC_DXT3_MESA
- set S2TC_DXT5 = GL_COMPRESSED_RGBA_S2TC_DXT5_MESA
- otherwise:
- set s3tc_supported = 0 and s2tc_supported = 0
Change all references to s3tc_supported to s2tc_supported, where it is
applicable to the case (e.g. depending on input source). Change all references
to GL_COMPRESSED_*_S3TC_*_EXT to S2TC_* where applicable.
Best regards,
Rudolf Polzer
More information about the mesa-dev
mailing list