Repository navigation
Fix high bridge shadow depth and darkening - #1029
Merged
Merged
Conversation
Route bridge own-shadows through the existing destination-edit renderer with native masks, cropped geometry, live raw state and ordered cell traversal. Keep signed depth admission, RGB565 halving and accepted Z stores with their existing shared owner. Remove the per-overlay classifier allocation. Native evidence: Cell0047F510, Get_Draw_Offset00480110, original SHP raster leaves00493830/00497390 and Tactical sweep006D6E5B..006D71D3; tools/spatial_oracle/bridge_shadow_render.md records executable coverage. Validated with native execution, exact GPU color/depth comparisons, strict retail library tests, CI clippy, live damage/repair and release captures. One independent read-only review completed; its allocation finding fixed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
High bridge shadows used a translucent black pass that bypassed per-pixel depth. They could darken foreground pixels and overlapping shadows, and were lighter than the original game. Bridge shadows now use the existing destination-edit renderer for native signed depth admission, RGB565 darkening and accepted depth writes.
The bridge atlas retains indexed masks and native crop geometry. The live-cell builder supplies raw frame/level/flags and native cell order. This covers high concrete bridges and the affected shared wood path, including damage, collapse and repair.
TerrainDrawRendererremains the sole destination-edit owner; simulation bridge facts keep their existing owners. No gameplay state, snapshot schema or shader arithmetic changed.Linked issue
None.
Evidence
Evidence and reproduction: original
0047F510, retail type/image reads, physical SHP frames, original Convert/raster leaves and Tactical cell sweep. The corpus contains 63 caller cases, 15 leaf controls and six-theater source-equivalence checks. Production atlas, builder and dispatch match every native color/depth pixel in both BGRA and RGBA sRGB attachments. The former bridge route first failed this GPU regression.Seven paired release captures cover both concrete orientations over land/water, multiple spans, authored broken concrete, and ordinary wood-bridge deck/underpass travel. Strict comparisons differ only in frame bytes; simulation hashes and complete input/observation transcripts match. A repeated candidate capture matches exactly. Separate live wood/concrete tests pass all four stages: loaded, damaged, collapsed and ordinary Engineer repair.
This does not establish native whole-scene or complete bridge-gameplay parity. Aircraft shadows and the separate
C_SHADOW/RAILBRDGpath remain outside this change. No RNG draws, gameplay timer writes or detach calls occur in the selected draw chain.Tests run
cargo test -p vera20k --lib: 9,567 passed, 0 failed, 231 ignoredcargo clippy -p vera20k --lib(CI set also included--bins --test '*' --examples): exit 0, existing warnings remainrustfmt --edition 2024on edited leaf filescargo run --release --bin vera20kCargo ran through
tools.cargo_run; full tests/clippy used physical INIs andVERA20K_REQUIRE_RETAIL_INI=1. Instead of a manual play session, the retained release executable ran seven reproducible retail-map observations plus an exact repeat. Native oracle--check, explicit ignored GPU comparisons, live HE/Engineer lifecycle checks and simulation field ratchet (2,532 baseline/current fields) passed. Validation receipts bind the logs and tested sources.Rendering cost is recorded, not assumed free: on Apple M4/Metal, debug prepare-to-completion medians for 16 adjacent shadows rose from 1.30 to 4.19 ms. A deliberately repeated 128-shadow stress case exercised bounded submissions. These include completion waits/readback; Metal returned zero timestamp endpoints, so no GPU-only or release-FPS claim is made. See the raw measurements.
Independent read-only review found no blocking correctness defect. Its allocation finding was fixed in the shared bridge-name classifier; afterward, 594 focused bridge tests and all three GPU correctness tests passed. The classifier keeps the same names and numeric identity semantics. A final retained release replayed the 753-step Hills scene and matched the validated capture exactly, including image bytes and all simulation observations.
AI assistance
Checklist