Skip to content

AssetStudio cross-check for the 6000.6 variant atlas sprites #230

Open

Description

@fatal10110

Package: packages/texture (npm unity-asset-reader-texture) tests; scripts/cross-check-fixture-oracles.py

Description

Follow-up of #229. The 6000.6.4f1 variant/sprites fixture's half atlas has two packed sprites (r_a, r_b) with downscaleMultiplier 0.5 on a 32x32 texture. #229 cuts them with the #153 resize, which matches AssetStudio's executed CutImage to the byte on the 2019.4 variant, but there is no byte-exact reference for these 6000.6 entries: UnityPy ignores the multiplier, and the 2019.4 cross-check (fixtures/assetstudio-fixture-cross-checks.json) does not apply because the 6000.6 variant texture's pixels differ from 2019.4's (256 of 1024 pixels). #229 checks them for AssetStudio's size, for the resize being applied (r_a lies outside the unscaled texture), and for being within 1.5 per channel (mean, opaque interior) of the full-scale master atlas' crop of the same sprite. The environment #229 was made in had no .NET SDK to run the harness.

Tasks

  • Let scripts/cross-check-fixture-oracles.py take the 6000.6 variant's inputs (texture bytes, textureRect, textureRectOffset, settingsRaw, downscaleMultiplier per m_RenderDataMap entry; read with UnityPy 1.25.4, which reads format 23), and run the pinned CutImage on them in the external .NET 8 harness (fixtures/BUILDING.md section 15), outside the repo (R2).
  • Attach the summaries to the variant entries of packedSprites in modern-goldens.json (make-modern-goldens.py), matched on their input metadata as make-goldens.py does for 2019.4.
  • Replace the closeness check in packages/texture/tests/sprite-6000-6.test.ts with the byte-exact one.

Acceptance

  • The 6000.6 variant's r_a and r_b decode to AssetStudio's executed CutImage image, to the byte.

Plan: docs/unity-asset-reader-plan.md. Behavior source of truth: Razviar/assetstudio (MIT). Golden oracle: UnityPy (MIT). MIT-derivative port: keep upstream copyright notices. Do not copy or import @arkntools/unity-js (AGPL-3.0), tests included. No C# compiled to WASM - C# is reference only, hand-ported to TS; WASM is built from C/C++ only (plan D2). Layout: npm-workspaces monorepo under packages/; dependencies point feature package -> core only (plan D7/D8, rules R13/R14).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:textureTexture and sprite decodingbacklogOn-demand, no named consumer yet

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions