Export every slice of arrays and volumes; map the 1-byte volume mip chain #289

Manually merged
github merged 2 commits from gh-pr/289/head into gh-pr/289/base 2026-11-26 20:24:55 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-25 15:28 UTC · original
holdmysocks:six-array-slices → master · +182 −28 · 4 files · 2 commits · merged 2026-11-25 16:21 UTC

Texture export now writes every slice of uncompressed arrays and volumes instead of slice 0 only. The one volume with mips decodes with its full chain.

Every slice

  • New slices_linear returns [mip][slice] for uncompressed textures with depth > 1.
  • The DDS is a 2D array, a cube map (dimension 2, slice count a multiple of 6) or a 3D texture (depth flag, volume caps, TEXTURE3D), with all slices. Single-slice DDS output is byte-identical to before.
  • <name>_slices.png stacks the slices top to bottom. <name>.png stays slice 0.
  • Checked on the texture dictionaries:
    • the 33×33×33 identity LUT volume DDS matches its coordinates to 3e-6 on all three axes;
    • all 32 layers of the 64×64 R16 blue noise are full permutations of 4,096 values, none repeated;
    • the four layers of both shore wave profiles are distinct, smooth curves.
  • Compressed arrays (BC7 gobos, damage maps) still export slice 0. Their slice layout isn't checked.

Volume mip chain (1-byte)

  • The R8 32×32×32 fog noise with 6 mips stores each 16-deep brick layer as its own chain: the mip-tail block, then mip 1, then mip 0. Layer 1's tail and mip-1 blocks are empty.
  • Mips 2–5 sit in the tail at bytes 2048, 768, 512 and 256, each at the element those bytes address through the brick equation.
  • Evidence:
    • each mip matches the one above averaged 2×2×2: 35, 33, 35, 43 and 66 dB;
    • mip 0 is as smooth across the layer seam as inside a brick (17.8 vs 19.1). The swapped layer order gives 45 there;
    • the tail's nonzero bytes are exactly those slots (585 = 8³+4³+2³+1).
  • The earlier finding that its mips were separate noise came from reading the wrong blocks.
  • Layout::new_3d_mips maps chains only for 1-byte elements and up to 4 tail mips, the one measured case. Others still return None.

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

**@⁠holdmysocks** on GitHub · 2026-11-25 15:28 UTC · [original](https://github.com/holdmysocks/SixNG/pull/289) `holdmysocks:six-array-slices` → `master` · +182 −28 · 4 files · 2 commits · merged 2026-11-25 16:21 UTC Texture export now writes every slice of uncompressed arrays and volumes instead of slice 0 only. The one volume with mips decodes with its full chain. **Every slice** - New `slices_linear` returns `[mip][slice]` for uncompressed textures with depth > 1. - The DDS is a 2D array, a cube map (dimension 2, slice count a multiple of 6) or a 3D texture (depth flag, volume caps, `TEXTURE3D`), with all slices. Single-slice DDS output is byte-identical to before. - `<name>_slices.png` stacks the slices top to bottom. `<name>.png` stays slice 0. - Checked on the texture dictionaries: - the 33×33×33 identity LUT volume DDS matches its coordinates to 3e-6 on all three axes; - all 32 layers of the 64×64 R16 blue noise are full permutations of 4,096 values, none repeated; - the four layers of both shore wave profiles are distinct, smooth curves. - Compressed arrays (BC7 gobos, damage maps) still export slice 0. Their slice layout isn't checked. **Volume mip chain (1-byte)** - The R8 32×32×32 fog noise with 6 mips stores each 16-deep brick layer as its own chain: the mip-tail block, then mip 1, then mip 0. Layer 1's tail and mip-1 blocks are empty. - Mips 2–5 sit in the tail at bytes 2048, 768, 512 and 256, each at the element those bytes address through the brick equation. - Evidence: - each mip matches the one above averaged 2×2×2: 35, 33, 35, 43 and 66 dB; - mip 0 is as smooth across the layer seam as inside a brick (17.8 vs 19.1). The swapped layer order gives 45 there; - the tail's nonzero bytes are exactly those slots (585 = 8³+4³+2³+1). - The earlier finding that its mips were separate noise came from reading the wrong blocks. - `Layout::new_3d_mips` maps chains only for 1-byte elements and up to 4 tail mips, the one measured case. Others still return `None`. 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:24:54 +00:00
github manually merged commit ee272de14c into gh-pr/289/base 2026-11-26 20:24:55 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.