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

Thread: Texture quallity problems

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2000
    Posts
    12

    Texture quallity problems

    In each of my textures, I use 4 bytes for each pixel. RGBA.
    Now when I load the texture using glTexImage2D with RGBA and 3 colour components, it looks fine, but i can't use the transparency.

    When i use 4 colour components, I can get transparency, but all the textures look like they have lost quality.

    Anyone got an explanation?

    thanks in advance

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    London
    Posts
    503

    Re: Texture quallity problems

    Could you explain what you mean by "lost quality"?

  3. #3
    Intern Contributor
    Join Date
    Feb 2000
    Location
    Italy
    Posts
    77

    Re: Texture quallity problems

    If the problem is color degradation, the only reason I can think of is that the driver is using different internal formats in the 2 situations. When it has to store 4-channel textures, it enables the alpha bits and losts some precision in representing other colors. This depends on how the driver has choosen to optimize texture representation, and maybe dithering.
    --
    Paolo M.

  4. #4
    Member Regular Contributor
    Join Date
    Feb 2000
    Location
    milano, italy
    Posts
    282

    Re: Texture quallity problems

    probably what you see are banding artifacts.

    i suppose that opengl systems developers choose to use less bits of precision (say 4) when
    using RGBA textures, for reasons like paolom say.
    the other components still use 8-bit, so colors render well only when alpha=0.

    i tested RGBA textures on tnt and g200 chips, and i noticed they can be seen only when alpha!=0.
    i didn't noticed any artifact when i upload texture as GL_ALPHA, so maybe this can be a way to avoid banding...
    maybe multitexturing (ie, unit1=GL_RGB, unit2=GL_ALPHA) could be a way to increase alpha precision, but i didn't tested it yet.
    Dolo/\/\ightY

  5. #5
    Junior Member Newbie
    Join Date
    Feb 2000
    Posts
    12

    Re: Texture quallity problems

    Thank you all for the replies.

    MikeC:
    The loss in quality is I have 16 bpp textures, but when I use 4 colour components, it looks like the textures are 8 bpp (256 colours)

  6. #6

    Re: Texture quallity problems

    Out of curiosity what video card is this?

    I have a TNT2 Ultra and I am having essentially the same problem, except I'm not exactly sure what it is, I am using 4 components but I have not tried leaving the alpha off, so I do not know the quality...

  7. #7
    Intern Contributor
    Join Date
    Feb 2000
    Location
    Italy
    Posts
    77

    Re: Texture quallity problems

    You could try to set manually a different internal format.
    If you must use 16bpp textures, the choice is restricted to two options: GL_RGBA4 (4-4-4-4) or GL_RGB5_A1 (5-5-5-1). The former allows for better blending, while the latter will offer much more precision in the color primaries (RGB components).
    If you can work with 32bit textures, you have the RGBA8 (8-8-8-8) format, which is probably the best in most cases: as a drawback, memory consumption is doubled.
    --
    Paolo M.

  8. #8
    Junior Member Newbie
    Join Date
    Feb 2000
    Posts
    12

    Re: Texture quallity problems

    Citizin X:
    I have a Voodoo Banshee 16mb Card. I wish now I had bought a TNT2 though, coz of problems with fog and my banshee

    paolom:
    Thanks for the help, i'll try em out asap

Posting Permissions

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