Jump to content
  • Advertisement
Sign in to follow this  
osmanb

OpenGL Compressed (DXT) textures w/mips come out all white?

This topic is 5064 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

Hey folks. I've been searching around, but not found any information on this at all. I've got a DDS loader in my project now, including support for loading the mipmaps in the file. We're only using DDS files for DXT1/3/5, so that's all I care about. My loader is based pretty much entirely off the NV sample code at http://developer.nvidia.com/object/OpenGL_S3TC_tutorial.html However, whenever I try to specify and mipmap based filtering (GL_NEAREST_MIPMAP_NEAREST all the way up to LINEAR_MIPMAP_LINEAR), the texture comes back pure white. I thought it might be a bug in my code, so I compiled that code I linked to, replaced their sample textures with a pre-compressed DDS file (DXT5) containing two mipmaps, and got the same bug. It's easy to see there, just rename the flowerdxt5.dds file to flowers128.dds, and cycle through the filtering modes for that texture (hit 'a' to switch to it). So... Has anyone ever had luck with mipmap filtering and S3 (DXT) compressed textures? Is there some magic trick I'm missing? Thanks, -Brian

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by osmanb
So... Has anyone ever had luck with mipmap filtering and S3 (DXT) compressed textures? Is there some magic trick I'm missing? Thanks,


Yes. I do it in my engine.

Share this post


Link to post
Share on other sites
>>So... Has anyone ever had luck with mipmap filtering and S3 (DXT) compressed textures? Is there some magic trick I'm missing? Thanks,<<

yes me too!!


but seriously, the thing with mipmaps + compression is the smallest size texture is 4x4 pixels
thus with normal mipmapping u go
32x32 -> 16x16 -> 8x8 -> 4x4 -> 2x2 -> 1x1
with texture compression u go
32x32 -> 16x16 -> 8x8 -> 4x4 -> 4x4 -> 4x4

this is where youre prolly stuffing up with, i know it got me first time as well

Share this post


Link to post
Share on other sites
Yeah, that's what i thought too - so I made my test case be a 512x512 texture, that only has two mips. (So the smallest dimensions are 256x256). But I've realized that my code isn't really the problem here. I've actually downloaded and compiled that NVidia code - with no modifications - and it doesn't work. I get the exact same bug. What I actually tried:

1) Download the NVidia texture compression sample from the URL I listed above.

2) Download glut from Nate Robbins' site.

3) Compile the above sample.

4) Replace flowers128.dds with flowersdxt5.dds (their pre-compressed sample), and try to view that file, with mipmap based filtering enabled.

Result: pure white. So it's not real surprising to me that my code doesn't work either - it's pretty much based on that code. (And I've tested the sample on both ATI and NV cards, with the same results). So I'm totally at a loss. The only example I have of "how to do this correctly" doesn't work either.

-Brian

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!