Hello all,
I am getting some behavior which I don’t understand when trying to replace pieces of a compressed texture. The texture is created like this :
glBindTexture(GL_TEXTURE_3D, texId);
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP);
glCompressedTexImage3D(GL_TEXTURE_3D, 0, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, width, height, depth, 0, bufSize, buffer);
Then replacing texture with already compressed image :
glCompressedTexSubImage3D(GL_TEXTURE_3D, 0, 0, 0, 0, subTexWidth, subTexHeight, 1, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, subTexSize, subTexBuffer);
This works fine when “depth” above is 1, but not for any larger number. Creating the buffer is still fine, however glGetError() returns “invalid operation” after the call to glCompressedTexSubImage3D.
Also, it works fine if I use an uncompressed image and do replacement like this:
glTexSubImage3D(GL_TEXTURE_3D, 0, 0, 0, 0, subTexSize, subTexSize, 1, GL_RGBA, GL_UNSIGNED_BYTE, unCompBuf);
I assume in this case it is compressing for me when uploading the image.
I also have one more question about this, which I believe is a separate issue. The largest width/height I can use seems to be 512/512 (anything larger causes glGetError() give “invalid value”). When creating an uncompressed 3d texture I can use 4096/4096 without any problems on the same hardware.
Thanks in advance.