- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.2k
solve issue 1619 (add texture-compression formats) #1621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| Thanks for your contribution, Toni! | 
| The BC4 and BC5 image colour issue is maybe expected. Since they store the colour info on the red or the red-green channel respectively. But I'm unsure that do we need to use some swizzle or handle this in a shader separately? I don't have enough knowledge on the use cases or whatnots on RGTC textures. | 
| How about providing test app(s) for this feature? | 
| 
 I can try to create similar to TestLoadKtx.java. Should be sufficient. Convert the monkey texture with Compressonator. | 
| Pushed a similar (but slightly refined :D ) test that I used to test these files. It includes a sample from all the BCx formats that are loaded with DDS file format. | 
Resolves #1619
This PR adds support for BPTC compressed textures. Namely BC6 and BC7 compressed formats. Earlier, BC1-BC5 formats were already somewhat supported, that support is now enhanced a bit by making the DDS loader support them more widely. The file format varies widely, both DX9(?) style and the DX10 style files are supported for both BPTC and RGTC (BC4, BC5) compressed textures.
The BPTC was mainlined in OpenGL 4.2. I put the constants to the EXT instead and check the capability from both the OpenGL version and the extension. There wasn't a file for GL4.2, so I didn't create one as I was little unsure how to integrate that. Therefore the GLExt houses these new constants. The version + extension checking I hope to make sure we utilize the feature even if the graphics driver doesn't give out all capabilities properly. Doesn't cost a thing...
There are some caveats. Support for flipping textures is limited. Not implemented at all for BC6 nor BC7. This is said to be extremely difficult but maybe not impossible. I can create a ticket for these flip issues.
Here is a report of findings of these formats (I used Compressonator to create these, the file formats vary wildly it seems):