I'm trying to make my loading a bit faster (right now engine loads TGA files, compress them and creates mipmaps and it takes too long) So my idea is to save already compressed textures and next time just copy-paste it to memory without compressing it another time. But there is a problem - I don't know how to save compressed textures to a file. I have to save data in format that is very easy for opengl to load. Same situation with mipmaps.
Asked
Active
Viewed 1,024 times
-1
-
1It's not entirely clear what you're asking here. Are you asking what the format of the data you get from OpenGL is? Are you asking how to develop a file format to store it in? Do you want to use DDS or a user-created format? Be more specific about what you're asking. – Nicol Bolas Jan 12 '13 at 19:58
-
1Also generally, you should be loading pre-compressed images, rather than compressing them at load-time. You'll get better results that way. – Nicol Bolas Jan 12 '13 at 19:58
-
Okay, so let's say that I want to use DDS format. What software do You recommand for compressing textures? ATI Compressonator? How can I integrate DDS format with opengl? – Skides Jan 12 '13 at 20:11
1 Answers
3
You can retrieve the compressed texture image data using glGetCompressedTexImage. You'll also likely need to retrieve the image format (details are at the bottom of the glGetCompressedTexImage man page). As for storing the image data, use any file format that matches your need (including just a simple binary file).

radical7
- 8,957
- 3
- 24
- 33