Jump to content
  • Advertisement
Sign in to follow this  
deavik

Saving mipmaps in a compressed texture [SOLVED]

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

I'm trying to save a texture compressed by OGL to disk and reading that at runtime, in this way:
Quote:
From ARB_texture_compression spec (10) Should functionality be provided to allow applications to save compressed images to disk and reuse them in subsequent runs without programming to specific formats? If so, how? RESOLVED: Yes. This can be done without knowledge of specific compression formats in the following manner: * Call TexImage with an uncompressed image and a generic compressed internal format. The texture image will be compressed by the GL, if possible. * Call GetTexLevelParameteriv with a <value> of TEXTURE_COMPRESSED_ARB to determine if the GL was able to store the image in compressed form. * Call GetTexLevelParameteriv with a <value> of TEXTURE_INTERNAL_FORMAT to determine the specific compressed image format in which the image is stored. * Call GetTexLevelParameteriv with a <value> of TEXTURE_COMPRESSED_IMAGE_SIZE_ARB to determine the size (in ubytes) of the compressed image that will be returned by the GL. Allocate a buffer of at least this size. * Call GetCompressedTexImageARB. The GL will write the compressed texture image into the allocated buffer. * Save the returned compressed image to disk, along with the associated width, height, depth, border parameters and the returned values of TEXTURE_COMPRESSED_IMAGE_SIZE_ARB and TEXTURE_INTERNAL_FORMAT. * Load the compressed image and its parameters, and call CompressedTexImage_[123]DARB to use the compressed image. The value of TEXTURE_INTERNAL_FORMAT should be used as <internalFormat> and the value of TEXTURE_COMPRESSED_IMAGE_SIZE_ARB should be used as <imageSize>.
My question, is can mipmaps be saved together with this at the same time to avoid generating them at runtime, like NV's DXT tool? I am using the GENERATE_MIPMAP_SGIS TexParameter. I tried setting this before saving to disk and just specifying a MIPMAP minification filter at runtime, but I got a white texture. It works if I generate mipmaps at run-time, though, but that's not what I want. [Edited by - deavik on January 21, 2006 8:10:11 AM]

Share this post


Link to post
Share on other sites
Advertisement
I just figured out I wan't saving the multiple mipmap images properly. I know what you're thinking ... but I'll get there in the end! [lol]

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!