mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-27 18:52:11 -04:00
a29bb7cddb
Adds a per-frame census of the Z the title actually emits (min/max/mean plus log2 buckets), read over the wire via pgxp_depth. This should have existed before any znear was chosen; two wrong values shipped because it did not. What it says for WipEout 3, on the demo savestate: min 125, max 28443, mean 5761, with the mass spread across 2^9..2^13. That immediately falsifies both earlier choices. znear=1 maps the whole scene into NDC [0.984, 0.99993] -- 0.8% of the depth range, so the test between any two objects is decided by float noise, which is exactly what the depth readout showed (ship 254-255, scene 254-255). And znear=128 does NOT "swallow the near field" as the previous commit message claimed: only 0.3% of vertices sit below 128. Sweeping znear at 32/64/100 against ship visibility gives 0.52/0.55/0.52 mean coverage versus 1.38 with depth off -- identical within noise. So the mapping is not the discriminator at all, and the reciprocal-vs-linear and znear work, while individually correct, were never the reason the ship vanished. Where it actually stands: at znear=64 the ship's median depth is 219 against 227 for the track around it, i.e. correctly NEARER. But the surrounding sample bottoms out at 0 -- fragments claiming the very near plane, which under GL_LEQUAL punch holes straight through the ship. Since the census says no vertex is below 125, those cannot come from real geometry, so the next step is validating which primitives get armed rather than tuning the projection any further. Depth stays OFF. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>