You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
texcmp: normalize normal-map packing before diffing; angle-based verdicts
A texture stored as a plain RGB normal map and the same texture in Unity's
AG-swizzle (DXT5nm convention: R pinned to 255, X in alpha, B copying G)
render identically through UnpackNormalmapRGorAG, but raw-decode as blue vs
pink — texcmp diffed the raw channels and reported every pixel different
(ppm=1e6, "visible") for render-identical bundles. Observed live on
stylizedWood_v01_normal.png pairs where upstream v49 swizzled a texture our
per-entity usage classification stored plain.
When either side of a matched texture shows the AG signature (R>=250 on
99% of pixels, varying alpha, B~G), both sides are re-expressed as
reconstructed normals (X, Y, sqrt(1-X^2-Y^2)) before the pixel diff, the
packing per side is recorded (normalPacking field + note), and
imperceptibility uses the perceptual quantity for normals: pixels tilted
more than 5 degrees must cover at most 200ppm of the image (mirrors the
render amnesty shape). maxNormalAngleDeg / normalAngleOverPpm are emitted
per texture.
Verified against live ab-cdn v49 bundles:
- packing-mismatch pair (same content): ppm 1e6 "visible" -> imperceptible
(137ppm of pixels over 5deg, max 16.5deg — cross-encoder block noise)
- both-AG pair (same content): ppm 19k "visible" -> imperceptible
(max angle 1.89deg, 0ppm over)
- genuinely different normal maps: stays visible (633ppm over 5deg)
- plain color textures: untouched code path, verdicts
unchanged
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments