nx_skin_pbr_gate.nx
buildroot/runtime/nx_skin_pbr_gate.nx
about
nx_skin_pbr_gate.nx -- GATE for the PBR map set (charsim R4, debt 1786549493 residue b+d).
THE TOOTH THAT MATTERS IS T7: the four maps must differ from EACH OTHER. An implementation that
returned albedo four times would pass every other tooth here and produce four files, which is exactly
the "file count moved, nothing else did" failure the rung was written to avoid.
T1 proves F0 is DERIVED, not typed: it recomputes Fresnel from the declared index and compares.
T4 is the anti-vacuity tooth: a relief field that was constant would give perfect unit-length normals
and perfect determinism while encoding no surface at all.
The physics teeth need no fixture, so this gate does not duplicate the sibling texbake fixture.
license_tier: ORIGINAL expect_exit: 0
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_nxa.nxnx_nxa_texc_lib.nxnx_nxa_texbake_lib.nxnx_gate_verdict.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 16 | const SP_REF: *u8 = "sites/nishifamily/world/ref9d.nxa" |
| 17 | const SP_TMP: *u8 = "/tmp/nxpbr_ref9d.nxa" |
| 18 | const SP_RES: i64 = 128 |
| 19 | const SP_RES4K: i64 = 4096 |
| 20 | const SP_SEED: i64 = 7 |
| 21 | const SP_SEED2: i64 = 8 |
| 22 | const SP_HUE: i64 = 500 |
| 23 | const SP_F0_PUBLISHED: i64 = 28 // ((1.4-1)/(1.4+1))^2 = 0.0278 -> 28 per mille, the textbook skin F0 |
| 24 | const SP_F0_TOL: i64 = 2 |
| 25 | const SP_LEN_TOL: i64 = 12 // unit-length tolerance on the decoded normal (127 nominal) |
| 26 | const SP_NOM: i64 = 127 |
| 27 | const SP_MID: i64 = 128 |
| 28 | const SP_SAMPLES: i64 = 64 |
| 29 | const SP_BADMAP: i64 = 99 |
| 30 | const SP_POLES: i64 = 5 |
| 31 | const SP_UNIT: i64 = 4096 // nx_trimesh represents 1.0 as 4096 in its normal fixed point |
| 32 | const SP_DIAG: i64 = 2364 // 4096/sqrt(3), the unit diagonal in that same fixed point |
| 33 | const SP_VEC_TOL: i64 = 140 // integer residue across two normalisations, ~3 percent of unit |
| 34 | const SP_TILT: i64 = 1200 // a real tangent tilt, not a whisper |
| 56 | const SP_CONV_RES_MIN: i64 = 8 // TXM_RES_MIN: the smallest bake the TEXM writer accepts |
| 57 | const SP_CONV_RES_MAX: i64 = 4096 // SP_RES4K: the floor T8 already bakes; the walk never exceeds it |
| 58 | const SP_CONV_STEP: i64 = 2 // the walk doubles -- every legal texture size is a power of two |
| 59 | const SP_RISE_STEPS: i64 = 4 // quantisation steps the fixture gradient must move G by before the |
| 62 | const SP_GRAD_FULL: i64 = 1023 // NTB_H_RANGE: the full relief codomain, the steepest gradient the |
functions
| 65 | func sp_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v } called by 1: main |
| 66 | func sp_bytes(res: i64) -> i64 { return res*res*3 + 64 } called by 1: main |
| 67 | func sp_ck(m: *u8, n: i64) -> i64 called by 1: main |
| 74 | func main(argc: i64, argv: *i64) -> i64 |