Jump to content
  • Advertisement
Sign in to follow this  
matt77hias

Block Compression for material parameters

Recommended Posts

I want to add AO to my roughness-metalness textures (according to the glTF2 format). Originally, I had two independent color channels for which I used BC5. Now, I have three independent color channels. Is it still beneficial to use BC? And if so what should I use: BC7?

Edited by matt77hias

Share this post


Link to post
Share on other sites
Advertisement

If you want to avoid information leakage between the channels during encoding, then stick to using multiple BC4/5 images... Otherwise, plenty of games get away with putting independent channels into a BC1/3 texture! With BC3, put them in AGRB channels by importance (A is independent or RGB, G has more precision than R/B). Using two BC1 images to store 6 channels of information does save you a lot of RAM compared to three BC5 images, but yeah, suffers from RGB being encoded non-independently from each other...

Using multiple BC4/5 images will likely still be better than using no compression at all.

Share this post


Link to post
Share on other sites
22 minutes ago, Hodgman said:

Otherwise, plenty of games get away with putting independent channels into a BC1/3 texture!

What about BC7? The HW needs more instructions than BC3, but on the other hand more encodings are possible? 

24 minutes ago, Hodgman said:

BC1

It reduces the number of bytes/pixel from 4 to 0.5. That seems very rude for three independent channels which will be compressed together.

Share this post


Link to post
Share on other sites

If you are heavily texture bound, then pack into BC7 ( i would never again use BC1 in 2017 ). If not, use BC4, it also give you opportunity to resolution difference between channels.

 

The GPU cost of BC1 vs BC7 ? Good question, there is obviously one, but is it visible ? Probably not most of the time, GPU are made to hide latency. It does not matters if you texture read take 100us or 400us if the GPU hide the cost by scheduling enough wavefronts :)

Share this post


Link to post
Share on other sites
15 minutes ago, galop1n said:

The GPU cost of BC1 vs BC7 ? Good question, there is obviously one, but is it visible ? Probably not most of the time, GPU are made to hide latency. It does not matters if you texture read take 100us or 400us if the GPU hide the cost by scheduling enough wavefronts

But that makes me wonder why you ever need to use BC3. BC7 can hypothetically obtain the same result as BC3, but it explores alternative encodings as well.

Share this post


Link to post
Share on other sites

There is a reason why one is 3 and one is 7. The latter is more recent, for years we only had 1-5.

 

Today, reasons to use BC3 would be : faster encoding (for realtime encoding or fast preview), support for legacy hardware, and maybe other but i don't see what.

Share this post


Link to post
Share on other sites
13 minutes ago, galop1n said:

There is a reason why one is 3 and one is 7. The latter is more recent, for years we only had 1-5.

Well there is also a BC1, but yeah... :)

13 minutes ago, galop1n said:

faster encoding (for realtime encoding or fast preview)

Here, you are referring to the content creation pipeline? That is not a big concern for me.

14 minutes ago, galop1n said:

support for legacy hardware

Since BC6/7 are included since D3D11, all hardware supporting D3D11 should be capable of handling these formats?

Share this post


Link to post
Share on other sites
3 minutes ago, matt77hias said:

Well there is also a BC1, but yeah... :)

Here, you are referring to the content creation pipeline? That is not a big concern for me.

Since BC6/7 are included since D3D11, all hardware supporting D3D11 should be capable of handling these formats?

Yes but you may have to support platforms other than that that do not. I was just giving potential reasons to not use BC6-7 :)

 

For the faster encoding, i was referring to the production pipeline, true, but also the game/application. It is common to see some picture capture that redo compression on result ( imagine avatar head mugshot, terrain albedo composition in texture space, ... ). There is also games that do things like virtual texturing and usually stored data in a more aggressive format and need to reconstruct the BCn texture.

 

On a side note, If BCn have been great to the GPU, they are still low citizen in compression and bad candidate to things like gzip. So, investing time extra compression of BC texture is a good idea if your game has a huge amount of content. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!