Map 1-byte single-mip volumes to the 3D layout #279

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

@⁠holdmysocks on GitHub · 2026-11-25 14:13 UTC · original
holdmysocks:six-r8-volumes → master · +12 −4 · 4 files · 10 commits · merged 2026-11-25 15:02 UTC

Single-mip volumes with 1-byte elements now use the 3D SW_4KB_S pattern instead of reading as 2D slices.

  • Pattern: 16×16×16 bricks, bits X0 X1 Z0 Y0 Z1 Y1 X2 Z2 Y2 X3 Z3 Y3 (low bit first).
  • How it was found: the same brute-force search over bit orders that found the 4-byte pattern, run on the R8 32×32×32 noise volume. Candidates are scored by neighbour smoothness along x, y and z.
  • How the axis labels were fixed: on a cube, relabelled axes score the same inside a brick, so the brick seams decide. With this order, neighbours across a brick boundary differ about as much as neighbours inside one (x 9.3 / 9.4, y 9.3 / 10.5, z 9.5 / 8.7). Every relabelling is 23–30 at the seams. The same test picks the measured 8-byte pattern and the 4-byte pattern from PR 270.
  • Not covered: the one volume with a mip chain (R8 32×32×32, 6 mips) still reads as 2D. Its mips are separate noise, not averages of mip 0, so their placement can't be checked.

Known gap: texture export writes only slice 0 of a 2D array. The other slices decode correctly: every slice of the 64×64×32 blue noise is an exact permutation of 4,096 values, and all four slices of both shore profiles are smooth. They just never reach a file.

Only 16-byte volumes are still rejected by the 3D layout; the test now uses BC7 as the rejected format.

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

**@⁠holdmysocks** on GitHub · 2026-11-25 14:13 UTC · [original](https://github.com/holdmysocks/SixNG/pull/279) `holdmysocks:six-r8-volumes` → `master` · +12 −4 · 4 files · 10 commits · merged 2026-11-25 15:02 UTC Single-mip volumes with 1-byte elements now use the 3D SW_4KB_S pattern instead of reading as 2D slices. - **Pattern:** 16×16×16 bricks, bits X0 X1 Z0 Y0 Z1 Y1 X2 Z2 Y2 X3 Z3 Y3 (low bit first). - **How it was found:** the same brute-force search over bit orders that found the 4-byte pattern, run on the R8 32×32×32 noise volume. Candidates are scored by neighbour smoothness along x, y and z. - **How the axis labels were fixed:** on a cube, relabelled axes score the same inside a brick, so the brick seams decide. With this order, neighbours across a brick boundary differ about as much as neighbours inside one (x 9.3 / 9.4, y 9.3 / 10.5, z 9.5 / 8.7). Every relabelling is 23–30 at the seams. The same test picks the measured 8-byte pattern and the 4-byte pattern from PR 270. - **Not covered:** the one volume with a mip chain (R8 32×32×32, 6 mips) still reads as 2D. Its mips are separate noise, not averages of mip 0, so their placement can't be checked. **Known gap:** texture export writes only slice 0 of a 2D array. The other slices decode correctly: every slice of the 64×64×32 blue noise is an exact permutation of 4,096 values, and all four slices of both shore profiles are smooth. They just never reach a file. Only 16-byte volumes are still rejected by the 3D layout; the test now uses BC7 as the rejected format. Checked with `cargo check --workspace --all-targets` and `cargo test -p sixng-core -p sixng-gui --release`.
Single-mip textures with 2- or 4-byte elements (R16 height maps, RGBA8 palettes and profiles, BGRA8 tiles) are stored in Gfx10 SW_4KB_S blocks, not the 16x16-element tiles mip0_linear assumed. SW_4KB_S is smoothest on 1,051 of 1,064 such textures; the others are noise, small volumes and flat tiles. The water export now uses the generic path, with byte-identical output.
Uncompressed textures with a mip chain (RGBA8, R8, A8, R32 float) were read as 16x16-element tiles. They use the Gfx10 SW_4KB_S chain layout: each mip now matches the mip above averaged 2x2 (exactly on the R32 float glow; 40-68 dB elsewhere, against 11-25 dB before). DDS export writes these chains whole.
# Conflicts:
#	README.md
#	crates/sixng-core/src/texture.rs
Single-mip 1- and 8-byte textures use SW_4KB_S like the rest. The texture header's dimension byte (+0x3E) marks volumes, which are untiled with the 3D pattern; the 4-byte 3D pattern is added (found by search, confirmed on a direction field). The 33^3 identity LUT and the 256x16 identity LUT decode exactly.
# Conflicts:
#	README.md
#	crates/sixng-core/src/texture.rs
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:23:58 +00:00
github manually merged commit b67c868b80 into gh-pr/279/base 2026-11-26 20:24:00 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.