BC6H and BC7 texture compression (DX11)

sebbbi

Veteran
I have been recently doing some DX11 research, and it seems that the exact specs of the BC6H and BC7 texture formats are not included in the August SDK (the first official SDK containing DX11 support).

The only information about BC6H/BC7 I managed to find was this one:
http://www.nvidia.com/content/nvisi...oper_Track/NVISION08-Direct3D_11_Overview.pdf

It lacks a lot of information I need to create my own BC6H and BC7 compressors. Does anyone know where I could find exact specs for these formats, with all the storage bits specified?

Update: According to quick look at the DirectCompute example HLSL code that compresses BC7 there seems to be 8 different modes to compress a block, and 64 different color partitioning styles. It's still a mystery for me how the alpha channel is handled, and how the second palette is stored...
 
Last edited by a moderator:
I'm sure Microsoft has all the details you need in their spec, the one that's not public (for some absolutely insane reason) and like only IHVs get to see.
 
BC6 and BC7 compressor and decompressor sources are in latest DX SDK as a sample.
Yes. However the compressor/decompressor example CPU path just uses a library function D3DX11LoadTextureFromTexture() to do the conversion. There is compression/decompression code at all, and no documentation. The compute shader path has no documentation either. All the split palette patters are just stored as binary data (magic hex numbers), etc, etc. Not helpful at all.

Yes, it would be possible to reverse engineer the completely undocumented compute shader code, but:
- It would take a lot of time.
- It's very likely that I miss some details by mistake, and my compressor does not work optimally.

I would like to see some documentation describing the new block format and how does the block format change between all the 8 different modes. And yes, I have reverse engineered some of the code to understand the basics, but this new format is much more complex than DXT1/DXT3/DXT5, so it would be really nice to include some kind of official format documentation in the SDK.
 
In the past I've found the inner workings of DXT through reading the OpenGL documentation. The 5870 has these two extensions:
GL_AMD_texture_compression_dxt6
GL_AMD_texture_compression_dxt7

So one way to approach this problem is emailing AMD and ask for the OpenGL extension specs for these, or wait until they show up on the OpenGL extension registry.
 
The Aug 2009 SDK DXSDK_Aug09.exe available directly from Microsoft has the source code (in HLSL) for DirectCompute versions of the BC6 and BC7 decoders and encoders. Take a look at the contents of the directory C:\Program Files\Microsoft DirectX SDK (August 2009)\Samples\C++\Direct3D11\BC6HBC7EncoderDecoder11 after you download the SDK.
 
The Aug 2009 SDK DXSDK_Aug09.exe available directly from Microsoft has the source code (in HLSL) for DirectCompute versions of the BC6 and BC7 decoders and encoders. Take a look at the contents of the directory C:\Program Files\Microsoft DirectX SDK (August 2009)\Samples\C++\Direct3D11\BC6HBC7EncoderDecoder11 after you download the SDK.
Yes, I know this... however the compute shader source is not documented at all, and the encoder/decoder both use a big set of predefined data arrays filled with random undocumented magic numbers and bit sequences. I would prefer to have real documentation about the formats instead of having to reverse engineer a completely undocumented compute shader (and figure out what all the bit patters really mean).

We have already decided to wait for the official documentation to arrive before we start to program support for the new BC formats. Hopefully the documentation and full specs are included in the next SDK version.
 
I've distributed the source code for my BC6/BC7 codecs to Ignacio Castano, so we should see them soon in Nvidia Texture Tools.

If you have a suggestion as to where else I should post the code, reply here and I'll put it there.
 
Back
Top