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 9 of 9

Thread: Loss of detail in texture

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    26

    Loss of detail in texture

    Hi all,

    I am doing some sort of a GUI uisng the 2D overlay method. But I seem to be losing the details in the textures that I am loading. FYI I am loading them from a tga file and using glAlphaFunc to 'blank out' what I don't want. The tga file when viewed through some other external programs ie Photoshop etc looks ok but when I load it into the program it looks all messed up (blurry).

  2. #2
    Junior Member Regular Contributor
    Join Date
    Sep 2001
    Location
    Eastern USA
    Posts
    220

    Re: Loss of detail in texture

    If you're distorting the image by mapping it in such a manner that it will have a different aspect ratio than the original image or if the resultant texels are larger or smaller than pixels (very likely) then OpenGL could very likely cause "blurriness" due to texture filtering.

    If this is the case, look into glTexParameter* and the GL_TEXTURE_MAG_FILTER and GL_TEXTURE_MIN_FILTER parameters. You can keep it from blurring them.

    Also, if your image is appearing to be diluted or missing colors, perhaps you're rendering at a lower bit depth than the original image was stored.

  3. #3
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    26

    Re: Loss of detail in texture

    the image is 1024 x 1024 being mapped onto a quad of the same size. GL_TEXTURE_MAG_FILTER is set to GL_LINEAR while GL_TEXTURE_MIN_FILTER is set to GL_LINEAR_MIPMAP_NEAREST. are these settings wrong?

  4. #4
    Junior Member Regular Contributor
    Join Date
    May 2001
    Location
    Omaha, NE US
    Posts
    119

    Re: Loss of detail in texture

    I'd guess you'd want it to be like
    Code :
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    I don't know if this'll do it though...for some reason, I'm having a crap problem drawing in 2D in my program too.

    Also, make sure you're using uncompressed targas.

  5. #5
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    26

    Re: Loss of detail in texture

    nope, it's still rather blur, still couldnt get it to be as 'sharp' as the image. any other ideas on where i could have gone wrong?

  6. #6
    Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Sydney, NSW, Australia
    Posts
    428

    Re: Loss of detail in texture

    Your probably using the mipmap texture filter? use the linear or nearest filter.
    :: Sleep is a poor substitute for caffeine ::

  7. #7
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    26

    Re: Loss of detail in texture

    i am using gl_linear for both. could that be the problem?

  8. #8
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    26

    Re: Loss of detail in texture

    thanks ppl for your help. figured out the problem alrady. the textures are in 32bits but my voodoo3 can only do 16.

  9. #9
    Junior Member Regular Contributor
    Join Date
    Sep 2001
    Location
    Eastern USA
    Posts
    220

    Re: Loss of detail in texture

    Also, if your image is appearing to be diluted or missing colors, perhaps you're rendering at a lower bit depth than the original image was stored.[/B]
    Booyah!

Posting Permissions

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