Jump to content
  • Advertisement
Sign in to follow this  
RPTD

OpenGL How to disable texture compression

This topic is 3126 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Trying to locate a problem in my textures I stumbled across broken compression in the ATI drivers. I used for testing a texture with a linear gradient from black to white. If I make the gradient using GLSL directly the gradient on screen is perfect as it should be. Using the loaded texture (a PNG so lossless from disk) I get a black and white gradient which is anything else than usable. It's riddled with banding and compression artifacts. Close-up 4x magnified to better showing the problem This totally kills textures and especially normal maps. *** Is there a way (in OpenGL) to force a driver to not use compression for a given texture? ***

Share this post


Link to post
Share on other sites
Advertisement
Are you sure the driver is compressing the texture, and that you aren't uploading the texture incorrectly?

If a driver is really compressing textures by its own, there is no way do disable that from GL.

Share this post


Link to post
Share on other sites
AFAIK OpenGL doesn't use compression if the specified internal texture format is one of the non-compressed ones:
Quote:
from ARB_texture_compression
The ARB_texture_compression extension allows an uncompressed texture to be compressed on the fly through the glTexImage2D call by setting its <internalFormat> parameter accordingly. This can be done in one of two ways: use a generic compressed internal format from Table 1 or use an explicit internal format like one offered by the S3TC extension listed in Table 2.

So if you don't tell OpenGL to compress and have those artifacts nonetheless, then probably something other is wrong..?


EDIT: There is also a possibility to verify whether a texture is actually compressed:
Quote:
from ARB_texture_compression
...make sure that the image has been properly compressed by checking the glGetTexLevelParameteriv with <pname> set to GL_TEXTURE_COMPRESSED_ARB. The returned <params> will be non-zero if the texture is effectively compressed.

Share this post


Link to post
Share on other sites
No, the uploading should be correct. Read somewhere though once that the Linux ATI driver has problems in that it compresses automatically which can cause troubles.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!