using ARB_texture_compression

I have been tryng to implement this extension in my engine, but i haven’t been sucesseful. At nvidia there is a document that speaks about this extension, and in the document they say this :

The ARB_texture_compression extension allows an uncompressed texture to be compressed on the fly though the glTexImage2D call by setting its <internal format> parameter accordingly. This can be done in two ways: use a generic compressed internal format from Table1 or use an explicit internal format like one offered by the S3TC extension listed in Table 2. Basically the “compressed internal format” works just like a texture with “base internal format” except that the data is compressed.

Table 1 has several formats, but for simplicity i choose this one :
GL_COMPRESSED_RGB_ARB

As i understand all i had to do was this :

glTexImage2D(GL_TEXTURE_2D, 0, 3, Texture.X, Texture.Y, 0, GL_COMPRESSED_RGB_ARB, GL_UNSIGNED_BYTE, Texture.data);

but all i get is white instead of the texture…

can anyone help?

thanks

Bruno

Sorry to sound obvious, but did you properly
check that the extension was supported?

Originally posted by Bruno:
glTexImage2D(GL_TEXTURE_2D, 0, 3, Texture.X, Texture.Y, 0, GL_COMPRESSED_RGB_ARB, GL_UNSIGNED_BYTE, Texture.data);

You put the enumerant in the wrong place. Replace 3 with GL_COMPRESSED_RGB_ARB and replace GL_COMPRESSED_RGB_ARB with GL_RGB.

Remember, the “components” argument from OpenGL 1.0 is now the “internalformat” argument in OpenGL 1.1 and on, and the old values of 1, 2, 3, and 4 mean the same thing as GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, and GL_RGBA.

  • Matt

Thanks a million…, i now can see my polygons, however something strange is happening, i’m using multitexturing to combine the texture with lightmaps, but now, my world is displayed only with lightmaps!!
Is there a special way to bind the images ?

thanks
Bruno

No, compressed textures can be used the same way ordinary textures are.

  • Matt