Files
benilla-octo/crates/benilla-formats/examples/png_disc.rs
T
SamandClaude Fable 5 a76530ab62 the minimap's black lines close out, and shared water cells draw once
- the Stormwind/Orgrimmar minimap lines are gone, at the cause: a group's boundary tile is authored 1.0 yd larger on that side alone, so touching groups overlap by 2 yd — without the bleed a LINEAR-filtered silhouette loses ≈0.38 texel at every abutment and the black clear reads through as a dashed line; with it, disc black goes 4.49% → 3.69% and no lines, inside the reference's own band
- the tile sampler stays LINEAR but filters in gamma space (`GL_SKIP_DECODE_EXT`, as the reference's trace has it) — a terrain underlay and a NEAREST sampler both reproduced the symptom and were both retracted as wrong once wow-re refuted them
- the canal-surface line in the world was a second defect: Stormwind's canal groups genuinely overlap (14,416 lattice points claimed wet twice), so the translucent sheet composited twice — the MLIQ `0x80` shared-tile gate now resolves each shared cell to one owner at load, pixel-identical and zero double-claimed points, not one wet point lost
- the interior composite is probeable headless now: `WOW_MM_PROBE` synthesises the minimap slot server-less, and an offline rebuilder reproduces the defect and the fix from the shipped art

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 18:01:55 +07:00

33 lines
1.2 KiB
Rust

//! TEMP (B141): what fraction of a captured minimap disc is the composite's black clear.
//! `cargo run -p benilla-formats --example png_disc -- <png> [cx cy r]` — defaults to the whole
//! image's inscribed circle, which is what the `WOW_MM_PROBE` crop is.
fn main() -> anyhow::Result<()> {
let a: Vec<String> = std::env::args().skip(1).collect();
let img = image::open(&a[0])?.to_rgb8();
let (w, h) = img.dimensions();
let cx = a.get(1).map_or(w as f32 * 0.5, |s| s.parse().unwrap());
let cy = a.get(2).map_or(h as f32 * 0.5, |s| s.parse().unwrap());
let r = a
.get(3)
.map_or(w.min(h) as f32 * 0.5 - 2.0, |s| s.parse().unwrap());
let (mut inside, mut black) = (0usize, 0usize);
for y in 0..h {
for x in 0..w {
if ((x as f32 + 0.5 - cx).powi(2) + (y as f32 + 0.5 - cy).powi(2)).sqrt() > r {
continue;
}
inside += 1;
let p = img.get_pixel(x, y).0;
if p[0] < 16 && p[1] < 16 && p[2] < 16 {
black += 1;
}
}
}
println!(
"{}: {:.2}% of the disc is clear-black ({black}/{inside})",
a[0],
100.0 * black as f32 / inside as f32
);
Ok(())
}