Welcome, Unregistered.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Reply
Old 02-Nov-2009, 14:17   #1
sebbbi
Senior Member
 
Join Date: Nov 2007
Posts: 1,340
Default BC6H and BC7 texture compression (DX11)

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/nvisio...1_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 sebbbi; 02-Nov-2009 at 14:35.
sebbbi is offline   Reply With Quote
Old 03-Nov-2009, 18:40   #2
sebbbi
Senior Member
 
Join Date: Nov 2007
Posts: 1,340
Default

Nobody? Looks like I have to fully reverse engineer the DirectCompute BC7 compressor then
sebbbi is offline   Reply With Quote
Old 03-Nov-2009, 19:35   #3
Humus
Crazy coder
 
Join Date: Feb 2002
Location: Stockholm, Sweden
Posts: 3,217
Send a message via ICQ to Humus Send a message via MSN to Humus
Default

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.
__________________
[ Visit my site ]
I speak for myself and only myself.
Humus is offline   Reply With Quote
Old 03-Nov-2009, 22:12   #4
martinsm
Registered
 
Join Date: Jan 2009
Posts: 9
Default

BC6 and BC7 compressor and decompressor sources are in latest DX SDK as a sample.
martinsm is offline   Reply With Quote
Old 04-Nov-2009, 12:36   #5
sebbbi
Senior Member
 
Join Date: Nov 2007
Posts: 1,340
Default

Quote:
Originally Posted by martinsm View Post
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.
sebbbi is offline   Reply With Quote
Old 04-Nov-2009, 22:16   #6
Humus
Crazy coder
 
Join Date: Feb 2002
Location: Stockholm, Sweden
Posts: 3,217
Send a message via ICQ to Humus Send a message via MSN to Humus
Default

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.
__________________
[ Visit my site ]
I speak for myself and only myself.
Humus is offline   Reply With Quote
Old 23-Nov-2009, 20:06   #7
Gorgonzola
Registered
 
Join Date: Feb 2005
Posts: 3
Default

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\BC6HBC7EncoderDecoder 11 after you download the SDK.
Gorgonzola is offline   Reply With Quote
Old 02-Dec-2009, 12:46   #8
sebbbi
Senior Member
 
Join Date: Nov 2007
Posts: 1,340
Default

Quote:
Originally Posted by Gorgonzola View Post
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\BC6HBC7EncoderDecoder 11 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.
sebbbi is offline   Reply With Quote
Old 12-Mar-2010, 00:35   #9
arjan de lumens
Senior Member
 
Join Date: Feb 2002
Location: gjethus, Norway
Posts: 1,259
Default

Documentation of DirectX11's BC6H and BC7 formats is now finally publicly available - in the form of an OpenGL extension only:
http://www.opengl.org/registry/specs...ssion_bptc.txt
arjan de lumens is offline   Reply With Quote
Old 04-Apr-2010, 13:48   #10
Ethatron
Member
 
Join Date: Jan 2010
Posts: 439
Default

Did I just read the word "anal" in an official OGL spec?
Ethatron is offline   Reply With Quote
Old 28-May-2010, 07:58   #11
Gorgonzola
Registered
 
Join Date: Feb 2005
Posts: 3
Default

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.
Gorgonzola is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:15.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.