Results 1 to 2 of 2

Thread: Textures and Quality

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2011
    Posts
    17

    Textures and Quality

    I have a bitmap, with text, that I'm attempting to get displayed on the screen. This isn't a problem in itself, as I simply create a texture based on the bitmap and display it. The problem is that the quality of the image is degraded to the point where the text is illegible, even when the area allocated to the image on the screen is equivalent to the texture size. I have experimented with glDrawPixels, and though the quality of the image this method generates is what I'm looking for, it degrades performance of the overall application to a non-acceptable level. So I have been experimenting with mipmap's, and have found no perceptible difference in the texture (leading me to conclude I'm not doing it right).

    This is being run on a ATI Radeon X1200 with opengl 2.1.8543 [edit] in linux [/edit].

    The original way I was generating the texture
    Code :
    glGenTextures( 1, &texId);
    glBindTexture(GL_TEXTURE_2D, texId);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 676, 1024, 0, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, bitmapdata);

    The current, attempting to generate mipmaps for a ledgable bitmap.
    Code :
    glGenTextures( 1, &texId);
    glBindTexture(GL_TEXTURE_2D, texId);
    glEnable(GL_TEXTURE_2D);
    glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
     
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
     
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 676, 1024, 0, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, bitmapdata);

    The current method appears to be consistent with opengl.org mipmap documentation. Any ideas as to where I'm messing up?

  2. #2
    Junior Member Newbie
    Join Date
    Mar 2011
    Posts
    17

    Re: Textures and Quality

    Sometimes it's the stupidest things that trip us up.

    The problem appears to be the size of the textures used. Creating the bitmap in a 1024x1024 buffer instead of the 676x1024 correct the quality problems I was seeing.

Similar Threads

  1. HELP!!! Textures are low quality!
    By Matt3214 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-23-2013, 01:25 AM
  2. "Transperent color" on the image and high quality textures
    By -=MadMan=- in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-11-2005, 10:48 PM
  3. poor quality with 1D textures
    By mithun_daa in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 12-02-2003, 07:22 AM
  4. Bad Quality
    By ImpactDNI in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-20-2002, 12:48 PM
  5. Texture Quality
    By Mongoose in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 12-05-2000, 12:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean