3D textures and compression
category: general [glöplog]
Hi everybody,
has anyone used texture compression on very large 3D textures (512^3 rgba) in opnelg/d3d ? What are your experiences, how efficient is it ?
has anyone used texture compression on very large 3D textures (512^3 rgba) in opnelg/d3d ? What are your experiences, how efficient is it ?
I've used DXT on volume textures (erm, VTC) in opengl - same compression ratios as DXT. sadly dxt on volume textures isnt supported in dx9.
It makes the texture layout more cache friendly so there's a potential speed benefit as well.
It makes the texture layout more cache friendly so there's a potential speed benefit as well.
smash: what tools did you use to compress to VTC? As for speed benefits, you can try to control the LOD of 3D textures inside a shader. It sometimes helps a lot.
bonzaj: ive got my own compressor. with a realtime version for spu. :)
the format is actually very simple - 4 slices of the usual 4x4 dxt block to give 4x4x4 - so the compressor is just a simple extension of dxt1.
the format is actually very simple - 4 slices of the usual 4x4 dxt block to give 4x4x4 - so the compressor is just a simple extension of dxt1.
smash: I was afraid you'll say that :). Hopefully what I had was just 128x128x32 and using tex3Dbias just did the trick. It's often good to choose the smallest mipmap depending on your view vector. It of course also depends on what you want to draw.
Bonzaj: you're still a licensed ps3 developer right? my compressor's on devnet somewhere i think, drop me a line. :)
Looks like I've accidentally walked in on a gathering of 31337 coders. I'll be on my way...
smash: oh, your coder is on devnet? nice, since i might have a use for the realtime spu version soon :) (work)
smash: Did you reach any of your potential speed benefits?
ryg: yea, drop me a mail and ill point you to it :) you got a devnet account?
amy diamond: a quick test abusing the texture lookups and replacing a xrgb888 texture with dxt1 (vtc1) doubled the speed - but its hard to test why, because the data's smaller as well as being laid out better.
amy diamond: a quick test abusing the texture lookups and replacing a xrgb888 texture with dxt1 (vtc1) doubled the speed - but its hard to test why, because the data's smaller as well as being laid out better.
god damn internet and god damn opengl. Nothing works !!
How do you get to do it ? I've tried:
glTexImage3DEXT(GL_TEXTURE_3D, 0, GL_COMPRESSED_LUMINANCE_LATC1_EXT, MaxX,MaxY,Vol.Size.z, 0, GL_LUMINANCE,
GL_UNSIGNED_BYTE, data8);
and then expected that
glGetTexLevelParameteriv(GL_TEXTURE_3D, 0, GL_TEXTURE_COMPRESSED_ARB,&compressed);
glGetTexLevelParameteriv(GL_TEXTURE_3D, 0, GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB, &compressed_size);
glGetTexLevelParameteriv(GL_TEXTURE_3D, 0, GL_TEXTURE_INTERNAL_FORMAT, &internalformat);
would work. Would they work fuck...
How do you get to do it ? I've tried:
glTexImage3DEXT(GL_TEXTURE_3D, 0, GL_COMPRESSED_LUMINANCE_LATC1_EXT, MaxX,MaxY,Vol.Size.z, 0, GL_LUMINANCE,
GL_UNSIGNED_BYTE, data8);
and then expected that
glGetTexLevelParameteriv(GL_TEXTURE_3D, 0, GL_TEXTURE_COMPRESSED_ARB,&compressed);
glGetTexLevelParameteriv(GL_TEXTURE_3D, 0, GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB, &compressed_size);
glGetTexLevelParameteriv(GL_TEXTURE_3D, 0, GL_TEXTURE_INTERNAL_FORMAT, &internalformat);
would work. Would they work fuck...
Shouldn't you be using glCompressedTexImage3D instead of glTexImage3D?
Actually, the EXT_texture_compression_latc extension spec doesn't seem to support using COMPRESSED_LUMINANCE_LATC1 for 3D textures at all.
NV_texture_compression_vtc allows you to use S3TC for 3D textures, btw. There is a mention (Issue #13) in the LATC-spec that clarifies why LATC isn't extended to 3D by the combination of NV_texture_compression_vtc and EXT_texture_compression_latc.
thanks ! is there something working for ATI I wonder
(I can only test all this tomorrow again :-(
(I can only test all this tomorrow again :-(
basically, another question:
GL_LUMINANCE4
what is this. I assume it is luminance in 4 bits (quantized down from 8) but I can't see any quantization artifacts at all when using it. GL_LUMINANCE and LUMINANCE4 seem to be exactly the same.
!?
GL_LUMINANCE4
what is this. I assume it is luminance in 4 bits (quantized down from 8) but I can't see any quantization artifacts at all when using it. GL_LUMINANCE and LUMINANCE4 seem to be exactly the same.
!?
it's suposed to be one 4bits channel. if it looks the same it's probably a driver thing. I think.
glCompressedBlabla loads an already compressed texture from ram, while glTextureblabla compresses an uncompressed texture when the target is GL_COMPRESSED_blabla. From what I read and could test.
there's a precision substitution for LUMINANCE4 - it's working like standard L8.
Check this out:
http://developer.nvidia.com/object/nv_ogl_texture_formats.html
As for the compressed textures - it's basically what kusma said. Currently only VTC is working.
Check this out:
http://developer.nvidia.com/object/nv_ogl_texture_formats.html
As for the compressed textures - it's basically what kusma said. Currently only VTC is working.
only VTC for rgb/rgba textures right ?