View Full Version : what's the deal with compressed textures?
01-01-2007, 03:37 AM
I mean, OpenGL wants the texture data to be unpacked and in this order: RGB or RGBA and so on for each pixel. So if I load all textures at once at the beginnig of my app, then what can I benefit from compression? Decompressing only takes time and OpenGL wants decompressed texture data.
01-01-2007, 04:42 AM
The OpenGL has special internal formats (e.g. GL_COMPRESSED_RGBA_S3TC_DXT3_EXT) and api functions (e.g. glCompressedTexImage2D) that can be used to specify the compressed data directly in one from supported formats.
01-01-2007, 07:10 AM
Are you talking about DXT?
DXT would be pretty useless if you have to decompress. Read about how to send compressed texture to GL http://opengl.org/registry/specs/EXT/texture_compression_s3tc.txt
Basically, your code will look something like this
glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, width, height, 0, imageSize, data);
01-01-2007, 08:49 AM
Hmm, there are some extensions that allow sending compressed texture data to OpenGL then. I did not know that. I hope they are widely supported on chips like GeForceFX and better?
01-01-2007, 11:52 AM
Hmm, there are some extensions that allow sending compressed texture data to OpenGL then. I did not know that. I hope they are widely supported on chips like GeForceFX and better?They were widely supported five years ago. Don't concern yourself about it.
01-01-2007, 08:12 PM
I made some experiments on rendering compressed textures on my NVidia fx5700. It was about 20 precents faster than rendering a non comressed RGB texture. So probably the time taking to render a comressed texture on the fly (decompressing and rendering it)is smaller than the time it takes to fetch a much bigger non compressed texture into GPU internal cache. As you said, you pay only once when loading the compressed texture the first time into the GPU (if it is in a non compressed format) and the benifit may be in rendering time.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.