Skip to content

More plain texture formats: R8, RG16, RG32, RGB48, RGBA64 #108

Closed

Description

@fatal10110

Package: packages/texture (npm unity-asset-reader-texture)

Description

#31 converts the plain formats plan M3 lists (Alpha8 ... YUY2). AssetStudio's Texture2DConverter.cs also decodes, in C#, R8, RG16, RG32, RGB48 and RGBA64, and maps its own R16_Alt to R16; Unity also has signed variants (R8_SIGNED ... RGBA64_SIGNED) that UnityPy handles. convertPlain throws UnsupportedError for all of them today. Out of scope for #31 (not in the issue or in plan M3's list), so parked here until a real bundle needs one. Raised while implementing #31.

Tasks

  • Add R8, RG16, RG32, RGB48, RGBA64 to convertPlain (DownScaleFrom16BitTo8Bit for the 16-bit ones, as upstream)
  • Decide on the signed variants and on R16_Alt (an AssetStudio-only enum value) and record it
  • Extend the plain fixture (fixtures/BUILDING.md section 6) and regenerate goldens with UnityPy

Port

AssetStudio.Utility/Texture2DConverter.cs (DecodeR8, DecodeRG16, DecodeRG32, DecodeRGB48, DecodeRGBA64)

Acceptance

  • One fixture texture per added format; RGBA sha256 = UnityPy golden, or the AssetStudio cross-check where UnityPy disagrees or cannot decode (as Plain texture formats in TS #31 does)

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