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 10 of 12

Thread: Mipmap questions

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2008
    Posts
    5

    Mipmap questions

    Hi,
    i would use gluBuild2DMipmaps to create my mipmap texture levels. I have some questions about it:

    1) Is this function GPU accelerated? If no, can be the CPU a more efficient alternative?
    2) If the mipmap is done by GPU how can transfer each level from the GPU to the CPU?

    Thanx.

  2. #2
    Advanced Member Frequent Contributor _NK47's Avatar
    Join Date
    Mar 2008
    Posts
    574

    Re: Mipmap questions

    1) No. Its built on CPU and uploaded to GPU.
    2) glGetTexImage()

  3. #3
    Junior Member Newbie
    Join Date
    Nov 2008
    Posts
    5

    Re: Mipmap questions

    1,2) Yes, it's right.
    Now, suppose the texture is already into the graphics memory and i want to build the mipmap. Which is the best strategy? A fragment program or transfer it on the CPU and use the gluBuld2DMimaps? (the texture is small).

  4. #4
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    936

    Re: Mipmap questions

    glGenerateMipmaps()
    or
    glTexParameter(GL_MIPMAPS_GENERATE, GL_TRUE)

    I prefer the first way in any case but the first way have been added for frame buffer object because sometime you generate your texture and you need to generate the mipmaps for it. Which seams to be your senario.

    The second way generates the mipmaps on the GPU too.

    For my point of view gluBuild2Dmipmaps is deprecated. I could be really useful when you want your software to support old or crappy hardware, like GeForce 5 and Radeon X*** (X**** is fine!)

  5. #5
    Member Regular Contributor
    Join Date
    May 2001
    Posts
    349

    Re: Mipmap questions

    GL_GENERATE_MIPMAP is deprecated in OpenGL 3.0 in favour of glGenerateMipmaps().

  6. #6
    Advanced Member Frequent Contributor _NK47's Avatar
    Join Date
    Mar 2008
    Posts
    574

    Re: Mipmap questions

    i think building mipmaps yourself is even better. you could do it in many ways from box to sync filter or some other fancy stuff. but glGenerateMipmaps() is totally sufficient today and is of course faster the doing it yourself.

  7. #7
    Junior Member Newbie
    Join Date
    Nov 2008
    Posts
    5

    Re: Mipmap questions

    glGenerateMipmaps() is really great for me because my texture is a framebuffer.

    Anyone has sample code about it?

Posting Permissions

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