I have 75 * 9 * 32 images, with a total of 64 MB on harddrive in PNG format. If I load the images, which are 128*256 pixels each, it takes up a whopping 1.5 GB of memory in RAM! I have no mipmapping enabled.
I am figuring this could be because the GPU only stores raw images, is there a way to tighten the memory usage?
I am loading the textures with the use of a framebuffer object, which is created only once.
I use the following for loading the textures:
QImage catchImage = catchFbo->toImage();
QImage t = QGLWidget::convertToGLFormat(catchImage);
glGenTextures( 1, &Item::texture[i] );
glBindTexture( GL_TEXTURE_2D, Item::texture[i] );
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, t.width(), t.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, t.bits() );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
EDIT: GL_COMPRESSED_RGBA instead of GL_RGBA seems to make a large difference. It now uses 500 MB.