pouët.net

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 ?
added on the 2008-12-11 14:38:32 by Navis Navis
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.
added on the 2008-12-11 15:22:19 by smash smash
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.
added on the 2008-12-11 15:43:50 by bonzaj bonzaj
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.
added on the 2008-12-11 15:54:34 by smash smash
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.
added on the 2008-12-11 16:25:00 by bonzaj bonzaj
Bonzaj: you're still a licensed ps3 developer right? my compressor's on devnet somewhere i think, drop me a line. :)
added on the 2008-12-11 16:29:46 by smash smash
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)
added on the 2008-12-11 22:38:28 by ryg ryg
smash: Did you reach any of your potential speed benefits?
added on the 2008-12-12 01:45:39 by Hatikvah Hatikvah
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.
added on the 2008-12-12 18:53:38 by smash smash
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...
added on the 2009-05-28 17:15:46 by Navis Navis
Shouldn't you be using glCompressedTexImage3D instead of glTexImage3D?
added on the 2009-05-28 17:32:30 by kusma kusma
Actually, the EXT_texture_compression_latc extension spec doesn't seem to support using COMPRESSED_LUMINANCE_LATC1 for 3D textures at all.
added on the 2009-05-28 17:38:08 by kusma kusma
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.
added on the 2009-05-28 17:51:10 by kusma kusma
thanks ! is there something working for ATI I wonder
(I can only test all this tomorrow again :-(
added on the 2009-05-28 18:48:39 by Navis Navis
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.

!?

added on the 2009-05-28 19:07:07 by Navis Navis
it's suposed to be one 4bits channel. if it looks the same it's probably a driver thing. I think.
added on the 2009-05-28 22:06:43 by xernobyl xernobyl
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.
added on the 2009-05-28 22:10:49 by xernobyl xernobyl
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.
added on the 2009-05-28 22:13:41 by bonzaj bonzaj
only VTC for rgb/rgba textures right ?
added on the 2009-05-29 10:38:07 by Navis Navis

login