"Editor auto-exposure makes screenshot comparisons report false positives"
You regenerate a scene to a known-good state (verified by data hash), take a screenshot, and diff it against a reference. The pixel diff reports 15–26% difference even though the underlying geometry is byte-identical. The difference is a global brightness/tint shift — not localized structural change.
Editor-viewport auto-exposure adapts over wall-clock frames. If the scene changed significantly between captures (e.g. flooding half the map with bright water, then draining it), the exposure system is mid-adaptation when you capture. Two shots of identical geometry taken seconds apart can differ by tens of percent because the exposure hasn't settled.
Two defenses, used together:
-
Settle the viewport before a comparison capture. After the scene reaches its target state, wait for the exposure to stabilize (~2–3 seconds is typically enough — verify by taking two back-to-back shots and confirming they diff to 0.000%).
-
Exposure-normalize the pixel diff. Before thresholding, match image B's per-channel mean to image A's. This cancels a uniform tint shift but preserves any localized structural difference (a real stale or overlapping element is not uniform and survives normalization). Post-normalization noise floor is typically 0.0–0.2%; real structural issues read 15–25% (100x above noise).
Keep a data-level hash (grid hash, serialized state, etc.) as the authoritative correctness gate. The screenshot diff is a coarse structural sanity check, not the primary comparator.
Auto-exposure is a temporal feedback loop — it adjusts brightness based on recent frame history, not instantaneous scene content. A settle window lets it converge. Exposure normalization algebraically removes the global scale factor (which is all auto-exposure contributes) while preserving spatial differences that indicate actual content mismatches. The combination makes screenshot diffs reliable for structural comparison without disabling auto-exposure entirely.