ttpf: --float writes float textures' unclamped values #211

Manually merged
github merged 2 commits from gh-pr/211/head into gh-pr/211/base 2026-11-26 20:18:31 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-24 21:31 UTC · original
holdmysocks:claude/ttpf-float-export → master · +79 −1 · 4 files · 2 commits · merged 2026-11-24 21:57 UTC

What

sixng ttpf <store> --hash <h> --float also writes a float-format texture's stored values, unclamped, as <hash>_m<mip>.f32: little-endian 32-bit floats, every slice of the mip in order, rows top to bottom, channels interleaved. The JSON result gives width, height, slices and channels. The PNG export is unchanged.

Why

Lookup tables in the texture stores (R16F, RG16F, RGBA16F, R32F) hold values outside 0..1. The PNG export clamps them and keeps 8 bits, so they cannot be used for shading maths. The hair lighting lookup tables are the case at hand (SIX-151).

Checked

  • New unit test floats_are_not_clamped (values above 1, negative values, short data, non-float formats).
  • Run on four float lookup tables of the graphics store (32x32x32 RGBA16F, 32x64x32 RGBA16F, 256x2 RGBA16F, 256x32x8 R16F): file sizes equal width x height x slices x channels x 4; maxima are 45.8, 0.67, 2.6 and 3.3, where the PNGs stop at 1.
  • Release build of the CLI.

Not done

  • No float export for BC6H textures or for textures in dictionaries and models.
  • Only one mip per run (--mip), as with the PNGs.
  • Not wired into --all summaries beyond one extra result row per float texture.
**@⁠holdmysocks** on GitHub · 2026-11-24 21:31 UTC · [original](https://github.com/holdmysocks/SixNG/pull/211) `holdmysocks:claude/ttpf-float-export` → `master` · +79 −1 · 4 files · 2 commits · merged 2026-11-24 21:57 UTC ## What `sixng ttpf <store> --hash <h> --float` also writes a float-format texture's stored values, unclamped, as `<hash>_m<mip>.f32`: little-endian 32-bit floats, every slice of the mip in order, rows top to bottom, channels interleaved. The JSON result gives width, height, slices and channels. The PNG export is unchanged. ## Why Lookup tables in the texture stores (R16F, RG16F, RGBA16F, R32F) hold values outside 0..1. The PNG export clamps them and keeps 8 bits, so they cannot be used for shading maths. The hair lighting lookup tables are the case at hand (SIX-151). ## Checked - New unit test `floats_are_not_clamped` (values above 1, negative values, short data, non-float formats). - Run on four float lookup tables of the graphics store (32x32x32 RGBA16F, 32x64x32 RGBA16F, 256x2 RGBA16F, 256x32x8 R16F): file sizes equal width x height x slices x channels x 4; maxima are 45.8, 0.67, 2.6 and 3.3, where the PNGs stop at 1. - Release build of the CLI. ## Not done - No float export for BC6H textures or for textures in dictionaries and models. - Only one mip per run (`--mip`), as with the PNGs. - Not wired into `--all` summaries beyond one extra result row per float texture.
Lookup tables stored as R16F / RG16F / RGBA16F / R32F hold values outside 0..1, which the PNG export clamps and quantises to 8 bits. --float also writes <hash>_m<mip>.f32: little-endian 32-bit floats, every slice of the mip in order, channels interleaved; the JSON result gives width, height, slices and channels.
# Conflicts:
#	crates/sixng-cli/src/main.rs
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:18:29 +00:00
github manually merged commit 0831d85fe3 into gh-pr/211/base 2026-11-26 20:18:31 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.