Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: DDS-textures and MipMapping?

  1. #1
    Junior Member Regular Contributor
    Join Date
    Oct 2002
    Posts
    164

    DDS-textures and MipMapping?

    Hello.
    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!
    I may not be good looking but I sure am dumb.

  2. #2
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: DDS-textures and MipMapping?

    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)
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  3. #3
    Junior Member Regular Contributor
    Join Date
    Oct 2002
    Posts
    164

    Re: DDS-textures and MipMapping?

    Hello.
    This is not OT because I am talking about
    ARB_texture_compression.
    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.
    I may not be good looking but I sure am dumb.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Jan 2001
    Location
    NVIDIA, Austin, TX
    Posts
    591

    Re: DDS-textures and MipMapping?

    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.

  5. #5
    Junior Member Regular Contributor
    Join Date
    Jan 2001
    Posts
    238

    Re: DDS-textures and MipMapping?

    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.

    -Evan


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

  6. #6
    Junior Member Regular Contributor
    Join Date
    Oct 2002
    Posts
    164

    Re: DDS-textures and MipMapping?

    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.
    I may not be good looking but I sure am dumb.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •