godot icon indicating copy to clipboard operation
godot copied to clipboard

Betsy: Implement BC4 compression

Open BlueCube3310 opened this issue 1 year ago • 1 comments
trafficstars

Adds support for BC4 / ATI1 / RGTC_R compression to Betsy. This is a prerequisite for BC3/BC5, since they use a separate BC4 block for storing their uncorrelated alpha and green channels respectively. In terms of performance, it is comparable to etcpak.

TODO:

  • [x] Add a testing project,
  • [x] Document the changes.

Future work:

  • Add BC3 and BC5,
  • Convert RGB-RGBA on the GPU,
  • Optimize mipmap compression,

MRP: betsyrgtcr.zip

BlueCube3310 avatar Sep 21 '24 20:09 BlueCube3310

@Calinou How do I queue this to run on the benchmark servers? Also can you take a look?

fire avatar Sep 22 '24 19:09 fire

How do you get a texture to import as BC4 in Godot? I've tried to import a grayscale PNG and a RGB PNG that only has a red channel (green/blue are fully black as confirmed in GIMP). However, both are imported as DXT1 with VRAM compression or BPTC RGBA with high-quality enabled (neither have an alpha channel).

test_vram_red_grayscale.zip

Calinou avatar Oct 12 '24 09:10 Calinou

How do you get a texture to import as BC4 in Godot? I've tried to import a grayscale PNG and a RGB PNG that only has a red channel (green/blue are fully black as confirmed in GIMP). However, both are imported as DXT1 with VRAM compression or BPTC RGBA with high-quality enabled (neither have an alpha channel).

test_vram_red_grayscale.zip

BC4 only works with red only images with the channel packing set to optimized

BlueCube3310 avatar Oct 12 '24 10:10 BlueCube3310

Thanks!

Repiteo avatar Oct 14 '24 19:10 Repiteo