BC6H and BC7 texture compression (DX11)

Discussion in 'Beginners Zone' started by sebbbi, Nov 2, 2009.

  1. sebbbi

    Veteran

    Joined:
    Nov 14, 2007
    Messages:
    2,049
    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...
     
    #1 sebbbi, Nov 2, 2009
    Last edited by a moderator: Nov 2, 2009
  2. sebbbi

    Veteran

    Joined:
    Nov 14, 2007
    Messages:
    2,049
    Nobody? Looks like I have to fully reverse engineer the DirectCompute BC7 compressor then :(
     
  3. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Location:
    Stockholm, Sweden
    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.
     
  4. martinsm

    Newcomer

    Joined:
    Jan 12, 2009
    Messages:
    9
    BC6 and BC7 compressor and decompressor sources are in latest DX SDK as a sample.
     
  5. sebbbi

    Veteran

    Joined:
    Nov 14, 2007
    Messages:
    2,049
    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.
     
  6. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Location:
    Stockholm, Sweden
    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.
     
  7. Gorgonzola

    Newcomer

    Joined:
    Feb 28, 2005
    Messages:
    3
    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.
     
  8. sebbbi

    Veteran

    Joined:
    Nov 14, 2007
    Messages:
    2,049
    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.
     
  9. arjan de lumens

    Veteran

    Joined:
    Feb 10, 2002
    Messages:
    1,274
    Location:
    gjethus, Norway
  10. Ethatron

    Regular Subscriber

    Joined:
    Jan 24, 2010
    Messages:
    673
    Did I just read the word "anal" in an official OGL spec? :lol:
     
  11. Gorgonzola

    Newcomer

    Joined:
    Feb 28, 2005
    Messages:
    3
    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.
     

Share This Page

Loading...