View Full Version : DDS-textures and MipMapping?

08-11-2003, 05:01 AM
I read and nvidia paper about ARB_texture_compression and used the provided code to open a *.dds file and upload the data to OGL.
I am confused about how mipmapping works.
According to the paper all mipmap-levels are included in the dds file and I just have to feed it to OGL with help off an offset in to the data array.
My question: Is it guaranteed that the mipmaps are included?

If this is not the case, what happens?
Thanks for information!

08-11-2003, 06:12 AM
This is OT *because* you are talking about a file format,
but I`ll give a quick reply:

nope, not all DDS have a mipmap. You can generate the mipmaps yourself using any algortihm you want.

PS: you can turn on automatic mipmapping (GL_SGIS_mipmaping or whatever it`s called)

08-11-2003, 06:29 AM
This is not OT because I am talking about
Are you sure that glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE) works here?
The paper says that all mipmaps have to be given to OGL manually in this case.

Sorry if I wasnt clear not the dds file-format as such is my problem, but how to correctly handle mipmapping when using ARB_texture_compression!

Thanks for the help.

08-11-2003, 08:20 AM
If you want to know if a given .dds file has mipmaps, check the dwMipMapCount part of the DDS header to see if its greater than zero.

Are you sure that glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE) works here?
Yes, automatic mipmap generation works fine with compressed textures.

08-11-2003, 09:36 AM
While it is true that SGIS_GEN_MIPMAP will work for compressed textures, (With the possible exception of a driver bug) it should be understood that this is unlikely to be something an app developer wants to do in a performance critical path.

Also, not to pile on here, but the way this question was asked also led me to believe it was an off-topic question about a file format. Something along the lines of, "How can I specify/generate mipmaps for a compressed texture of this format?", might be more likely to lead to a helpful answer.


[This message has been edited by ehart (edited 08-11-2003).]

08-11-2003, 01:47 PM
Thanks for the answers. Things seem much clearer now!
I appologize for the formulation of the question and I hope it turned out allright in the end.