Problems with S3TC

Hi @ll!

I´m currently playing arround wit S3TC on my GF2 GTS. I looked at the NVIDIA demo for S3TC, but I have got a few problems.

  1. I have got a DDS file that contains a 20482048 texture with 11 mipmap levels (from 10241024 downwards) the format is GL_COMPRESSED_RGB_S3TC_DXT1_EXT
  2. I allocate the memory for the DDS file
  3. I read the file into a buffer
  4. the code for getting the S3TC image size is the one from the NV demo (MipMapSize = ((TempTexture.Width + 3) / 4) * ((TempTexture.Height + 3) / 4) * BlockSize

I don´t understand why there is in brackets + 3? If the texture is 22 or 11 pixels, the buffer is allways 8 bytes.

I read that S3TC textures smaller than 4*4 pixels cause an error or are ignored, is that right?

If I try to leave out the mipmaps smaller than 44 pixels, no S3TC textures are drawn, nothing works, if I let OGL load the 22 and 1*1 mipmaps everything works, but why?

Perhaps anyone has got some good answers for me sigh?

By the way I think there are a few errors in the NV S3TC demo (buffer for DDS is too large, no support for 3 Bit color depth -> GL_COMPRESSED_RGB_S3TC_DXT1_EXT … etc.), but no one at NVIDIA answered my mails :frowning:


(hope not too confusing for you all, well I AM confused)


First of all, I am sorry to hear that nobody anwsered your question from NVidia. On the other hand, I have my Email stated into the source file and you haven’t sent me anything!?!? So, as a rule of thumb, when you have questions about a demo or the technology related to this demo, please try to Email directly the person who wrote the demo!

That being said,

  • The reason why +3’s are in the bracket is to ensure that the compressed 2x2 mipmap is defined by a 4x4 block. As you may be aware of, s3tc compresses images into 4x4 blocks. Compressing anything smaller still leads to a 4x4!

  • Yes, if you specify a 2x2 image size, you have to pass a buffer that encodes a 4x4 block, otherwise you will get an error.

  • The OpenGL specification defines mipmaps as a set of textures resized (and refiltered)until they reach 1x1 to be well defined - see OpenGL specs.

  • GL_COMPRESSED_RGB_S3TC_DXT1_EXT and GL_COMPRESSED_RGBA_S3TC_DXT1_EXT are no different in term of data. Actually, RGB has an alpha bit but it is discarded when specified as an RGB.

I hope it helped!
Please don’t hesitate to contact me for any other confusion

oh, by the way, I think you are correct the buffer is too large (but I am not positive about the correct size since the s3tc adobe plugin is not setting all the surface description fields properly!). Also, I vividly recommend you to use DXT3/5 if you have any gradient rich images!


Hey thanx Sébastien for the very quick answer! I think you are the one I sent my question, but I didn´t get an answer. Perhaps my questions in the mail was too stupid g ;-)!
You E-Mail is:, or? I mailed to this address, but nothing happend. Well OK, I will send you my source for the S3TC stuff and perhaps you can correct the parts that are wrong (it´s not that much and currently a bit hacked code)!



His address is :

And you are lucky coz’ Sebastien actually answers his e-mails ! (which is not the case for everyone at nVidia but I believe they receive a bunch of e-mails each day !).



No one at nVidia responded to my email either…

I even set it out in neat style…but still nothing…I was asking about developer registration and sent to the dedicated address for it…

[This message has been edited by drakaza (edited 07-07-2000).]

Well, I got one mail from sdomine, that answered my early questions very good, but I still have got some major problems with the S3TC function I use.
I sent him another mail, but got no answer back … perhaps he has got very much to do.
I think he gets a lot of mails and has got other things to do at NVIDIA, too …

But Sebastien, if you read this, please reply to the mail I sent to you … would be very kind!


One other small question.
I know there is a tool in the DX7 SDK, that is able to create DXT1, DXT3, DXT5 DDS files? Where can I get this app?