Export every slice of block-compressed arrays and cube maps #300

Manually merged
github merged 2 commits from gh-pr/300/head into gh-pr/300/base 2026-11-26 20:25:40 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-25 18:30 UTC · original
holdmysocks:six-bc-slices → master · +31 −11 · 2 files · 2 commits · merged 2026-11-25 19:07 UTC

Texture export now writes every slice of block-compressed arrays and cube maps from the texture dictionaries. Before, only slice 0 was written. This closes the gap left by PR 289, which did the same for uncompressed textures.

Layout. In the texture dictionaries, BC arrays are stored slice by slice, each slice with its whole SW_4KB_S mip chain. The bulk stores, by contrast, store them level by level. Measured on the dictionary BC7 arrays:

  • Blood map (5 layers) and crumple normal map (2 layers): mip 1 of every slice matches its mip 0 averaged 2×2.
    • Slice by slice gives 38–43 dB and 46–99 dB.
    • Level by level gives 11–16 dB.
  • Slice 0 under this layout: byte-identical to the existing single-slice decode.
  • Spot gobos (53 layers) and gobo cube maps (156 faces): both orders give the same result, since each slice is one 4 KiB block. Every layer is a distinct, clean light shape or logo.

Output. slices_linear now covers BC arrays and cubes, with the mips that exportable_mips already allows. The DDS is a 2D array or cube map, slice by slice. Exported sizes:

  • blood map: 5 layers × 3 mips, 1,720,320 bytes;
  • gobo cubes: 26 cube maps, cube flag set.

<name>_slices.png stacks mip 0 of every slice.

Not covered: the one BC volume, a BC5 128×128×128 cloud volume. It fits neither 2D order, its 3D BC layout isn't mapped, and it still exports its first slice.

Checked with cargo check --workspace --all-targets and cargo test -p sixng-core -p sixng-gui --release.

**@⁠holdmysocks** on GitHub · 2026-11-25 18:30 UTC · [original](https://github.com/holdmysocks/SixNG/pull/300) `holdmysocks:six-bc-slices` → `master` · +31 −11 · 2 files · 2 commits · merged 2026-11-25 19:07 UTC Texture export now writes every slice of block-compressed arrays and cube maps from the texture dictionaries. Before, only slice 0 was written. This closes the gap left by PR 289, which did the same for uncompressed textures. **Layout.** In the texture dictionaries, BC arrays are stored slice by slice, each slice with its whole `SW_4KB_S` mip chain. The bulk stores, by contrast, store them level by level. Measured on the dictionary BC7 arrays: - **Blood map (5 layers) and crumple normal map (2 layers):** mip 1 of every slice matches its mip 0 averaged 2×2. - Slice by slice gives 38–43 dB and 46–99 dB. - Level by level gives 11–16 dB. - **Slice 0 under this layout:** byte-identical to the existing single-slice decode. - **Spot gobos (53 layers) and gobo cube maps (156 faces):** both orders give the same result, since each slice is one 4 KiB block. Every layer is a distinct, clean light shape or logo. **Output.** `slices_linear` now covers BC arrays and cubes, with the mips that `exportable_mips` already allows. The DDS is a 2D array or cube map, slice by slice. Exported sizes: - blood map: 5 layers × 3 mips, 1,720,320 bytes; - gobo cubes: 26 cube maps, cube flag set. `<name>_slices.png` stacks mip 0 of every slice. **Not covered:** the one BC volume, a BC5 128×128×128 cloud volume. It fits neither 2D order, its 3D BC layout isn't mapped, and it still exports its first slice. Checked with `cargo check --workspace --all-targets` and `cargo test -p sixng-core -p sixng-gui --release`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:25:38 +00:00
github manually merged commit 04e17a1175 into gh-pr/300/base 2026-11-26 20:25:40 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.