GL_S3_s3tc

Hi,
Can anyone point me to somewhere that details the extension GL_S3_s3tc?

Please dont just tell me to use something newer, that is not an option. I’m looking for any token definitions for this extension, but it’s not listed in the extension registry, and I can’t find it anywhere on the net. It used to be in the nvidia drivers I believe ages ago, perhaps Matt or Cass has details for it?

Thanks,
Nutty

I thought that GL_S3_s3tc was promoted to GL_EXT_texture_compression_s3tc to fit in line with the GL_ARB_texture_compression model and because of it’s wide acceptance?! If I’m not mistaken, I believe that the tokens for the EXT should be the same as the S3??

I shall take a look at some old stuff I have laying around on my harddrive at home and see what I’ve got.

Dan

Perhaps, but the person I’m trying to help, said he used the token definitions for GL_EXT_texture_compression_s3tc, but it resulted in nothing being shown texture wise.

Unless it used some other tokens apart from DXT1, DXT3, DXT5?

Something to begin with (found on google):
Extends glTexImage2D to accept S3TC compressed texture format.

I. Changes to glTexImage2D
The general form of glTexImage2D is:

glTexImage2D( Glenum target,
Glint level,
Glint internalformat,
Glsizei width,
Glsizei height,
Glint border,
Glenum format,
Glenum type,
Const Glvoid *pixels )

  1. Changes to the format Parameter
    GL_RGB_S3TC (0x83A0)
    GL_RGB4_S3TC (0x83A1)
    GL_RGBA_S3TC (0x83A2) (currently not used)
    GL_RGBA4_S3TC (0x83A3) (currently not used)

  2. Changes to the internalformat Parameter
    GL_RGB_S3TC (0x83A0)
    GL_RGB4_S3TC (0x83A1)
    GL_RGBA_S3TC (0x83A2) (currently not used)
    GL_RGBA4_S3TC (0x83A3) (currently not used)

GL_RGB_S3TC and GL_RGBA_S3TC let the driver pick the type – for now just GL_RGB4_S3TC and GL_RGBA4_S3TC
respectively.

  1. Changes to the level Parameter
    Level takes negative numbers for GL_RGB_S3TC and GL_RGBA_S3TC formats only. Any other formats will generate an
    error.

The negative number indicates the pixels contain 0 to abs(level) mipmaps.

  1. Pixels
    For GL_RGB_S3TC, GL_RGB4_S3TC, GL_RGBA_S3TC, and GL_RGBA4_S3TC formats, pixels must be linear, and contain the
    untiled compressed image.

II. Other Changes

  1. glGetString
    GL_S3_s3tc is included in the string returned by GL_EXTENSIONS argument.

III. Limitations for the First Release

  1. glTexSubImage2D
    glTexSubImage2D will be supported (though not in this version), but requires the starting position (x, y) of
    an input image be at a 16 texel boundary, i.e.

x = 4 * n,
y = 4 * m

where m and n are some positive integer.

The width and height of a sub-image needs to be following:

Width = 4 * i,
Height = 4 * j

Where i > = 1 and j > = 1.

  1. Format
    The driver currently handle the formats and internalformats GL_RGB_S3TC and GL_RGB4_S3TC. The formats GL_RGB,
    GL_RGBA, GL_BGR_EXT, and GL_BGRA_EXT and the internalformats GL_RGB_S3TC and GL_RGB4_S3TC are supported as
    well. Any mixing of other formats is not handled.

  2. glCopyTexImage2D
    glCopyTexImage2D() is not supported.

IV. Permanent Limitations
GL_RGB_S3TC, GL_RGB4_S3TC, GL_RGBA_S3TC, and GL_RGBA4_S3TC are useful only for texture functions.

S3TC Texture Extension In OpenGL
Version 1.0
Date: 6/26/98

Extends glTexImage2D to accept S3TC compressed texture format.

I. Changes to glTexImage2D
The general form of glTexImage2D is:

glTexImage2D( Glenum target,
Glint level,
Glint internalformat,
Glsizei width,
Glsizei height,
Glint border,
Glenum format,
Glenum type,
Const Glvoid *pixels )

  1. Changes to the format Parameter
    GL_RGB_S3TC (0x83A0)
    GL_RGB4_S3TC (0x83A1)
    GL_RGBA_S3TC (0x83A2) (currently not used)
    GL_RGBA4_S3TC (0x83A3) (currently not used)

  2. Changes to the internalformat Parameter
    GL_RGB_S3TC (0x83A0)
    GL_RGB4_S3TC (0x83A1)
    GL_RGBA_S3TC (0x83A2) (currently not used)
    GL_RGBA4_S3TC (0x83A3) (currently not used)

GL_RGB_S3TC and GL_RGBA_S3TC let the driver pick the type – for now just GL_RGB4_S3TC and GL_RGBA4_S3TC
respectively.

  1. Changes to the level Parameter
    Level takes negative numbers for GL_RGB_S3TC and GL_RGBA_S3TC formats only. Any other formats will generate an
    error.

The negative number indicates the pixels contain 0 to abs(level) mipmaps.

  1. Pixels
    For GL_RGB_S3TC, GL_RGB4_S3TC, GL_RGBA_S3TC, and GL_RGBA4_S3TC formats, pixels must be linear, and contain the
    untiled compressed image.

II. Other Changes

  1. glGetString
    GL_S3_s3tc is included in the string returned by GL_EXTENSIONS argument.

III. Limitations for the First Release

  1. glTexSubImage2D
    glTexSubImage2D will be supported (though not in this version), but requires the starting position (x, y) of
    an input image be at a 16 texel boundary, i.e.

x = 4 * n,
y = 4 * m

where m and n are some positive integer.

The width and height of a sub-image needs to be following:

Width = 4 * i,
Height = 4 * j

Where i > = 1 and j > = 1.

  1. Format
    The driver currently handle the formats and internalformats GL_RGB_S3TC and GL_RGB4_S3TC. The formats GL_RGB,
    GL_RGBA, GL_BGR_EXT, and GL_BGRA_EXT and the internalformats GL_RGB_S3TC and GL_RGB4_S3TC are supported as
    well. Any mixing of other formats is not handled.

  2. glCopyTexImage2D

glCopyTexImage2D() is not supported.

IV. Permanent Limitations

GL_RGB_S3TC, GL_RGB4_S3TC, GL_RGBA_S3TC, and GL_RGBA4_S3TC are useful only for texture functions.

this code snipet may be of some kind of interest too:

groups.google.com/groups?hl=en&lr=&ie=UTF-8&safe=off&selm=95n782%24jp6%241%40nnrp1.deja.com

Julien.

Aha!!
Top darts that man!

1 question.

Changes to the level Parameter
Level takes negative numbers for GL_RGB_S3TC and GL_RGBA_S3TC formats only. Any other formats will generate an
error.

The negative number indicates the pixels contain 0 to abs(level) mipmaps.

NEGATIVE?!? Thats a bit stupid really. But anyway, so for non mipmapped texture, I assume level is still 0, right?

cheers!

Nutty

P.S. Erm… it seems you need to pass over a pre-compressed image too, bah…

[This message has been edited by Nutty (edited 08-13-2002).]