Exports currently go out untextured. data/hd holds roughly 3,800 .texture files and there is no public byte-level spec for the format.
Working out the format
The method that cracked Diablo III's .tex, which is the same shape of problem:
- Hexdump the first 128 bytes of a few hundred files and histogram them — a fixed magic and version fall out immediately.
- Find width and height by looking for plausible power-of-two pairs, cross-checked against file size: a BC surface with a full mip chain is roughly
w*h*bpp/8 * 4/3.
- Identify the format enum by correlating the byte that varies with the implied bytes per pixel.
- Validate by decoding to PNG and looking at it. A wrong stride is instantly visible; a wrong format is a plausible-but-wrong palette.
Expect BC7 and BC5 where D3 only needed BC1/BC2/BC3. BC7 decode is fiddly (8 modes) but well documented, and no re-encoding is needed for .dds export — block data passes through losslessly. D3's split component streams are a Blizzard-ism unlikely to recur in another studio's pipeline.
Acceptance: 200 random .texture files decode with zero exceptions, and twenty of them look right.
Materials
D2R materials are PBR triples — alb / nrm / orm — referenced from texture_desc_casche.json under data/hd. Two payoffs:
- glTF: ORM is already glTF's own channel packing (occlusion R, roughness G, metallic B), so albedo/normal/ORM map onto
baseColorTexture / normalTexture / metallicRoughnessTexture with no conversion at all.
.m3: SC2's MAT_ V20 has real normal and specular layer slots. Wiring them up would make these exports look markedly better in the SC2 editor than the D3 tool's diffuse-only ones.
Alpha cutout
D2R art is full of alpha-tested cloth, hair, capes and foliage, so the alpha-mask path in M3Writer matters here. D3ModelViewer/docs/SC2-ALPHA-MASK-LAYER-BUG.md explains why SC2 samples the material's Alpha Mask layer slot rather than the diffuse alpha — that finding is expensive to re-derive and applies unchanged.
Exports currently go out untextured.
data/hdholds roughly 3,800.texturefiles and there is no public byte-level spec for the format.Working out the format
The method that cracked Diablo III's
.tex, which is the same shape of problem:w*h*bpp/8 * 4/3.Expect BC7 and BC5 where D3 only needed BC1/BC2/BC3. BC7 decode is fiddly (8 modes) but well documented, and no re-encoding is needed for
.ddsexport — block data passes through losslessly. D3's split component streams are a Blizzard-ism unlikely to recur in another studio's pipeline.Acceptance: 200 random
.texturefiles decode with zero exceptions, and twenty of them look right.Materials
D2R materials are PBR triples —
alb/nrm/orm— referenced fromtexture_desc_casche.jsonunderdata/hd. Two payoffs:baseColorTexture/normalTexture/metallicRoughnessTexturewith no conversion at all..m3: SC2'sMAT_V20 has real normal and specular layer slots. Wiring them up would make these exports look markedly better in the SC2 editor than the D3 tool's diffuse-only ones.Alpha cutout
D2R art is full of alpha-tested cloth, hair, capes and foliage, so the alpha-mask path in
M3Writermatters here.D3ModelViewer/docs/SC2-ALPHA-MASK-LAYER-BUG.mdexplains why SC2 samples the material's Alpha Mask layer slot rather than the diffuse alpha — that finding is expensive to re-derive and applies unchanged.