Skip to content

deadlock: fix Brighter lighting magenta shading and KV3 v5 zero-blob trailer - #308

Merged
rndaom merged 2 commits into
mainfrom
rndaom/deadlock-brighter-lighting-fix
Dec 6, 2026
Merged

rndaom merged 2 commits into
mainfrom
rndaom/deadlock-brighter-lighting-fix

Conversation

@rndaom

@rndaom rndaom commented Dec 6, 2026

Copy link
Copy Markdown
Owner

What broke

Enabling Performance → Performance mods → Brighter lighting turned Deadlock's 3D scene black and magenta while leaving 2D HUD elements normal.

Why

  1. patch_brighter_vpost_bytes cleared m_nColorCorrectionVolumeDim to 0 and m_colorCorrectionVolumeData to an empty blob (0 bytes). Stock Deadlock .vpost_c files always carry a full 32×32×32 (131,072-byte) RGBA identity LUT even when m_bHasColorCorrection is false; without a valid 3D LUT blob, Source 2 falls back to the black-and-magenta error texture in the post-processing pass.
  2. encode_kv3_v5 only appended the trailing 0xFFEEDD00 blob-section end marker when blobs_bytes > 0, omitting it when count_blobs > 0 with a 0-byte blob.
  3. patch_brighter_vpost_bytes also unconditionally added m_bHasLocalExposureParams / m_bHasFogScatteringParams to older KV3 v4 .vpost_c files that do not define them.

What changed

  • Write a canonical 32×32×32 RGBA identity LUT (identity_color_correction_lut_32, 131,072 bytes) with m_nColorCorrectionVolumeDim = 32 and m_bHasColorCorrection = false in patch_brighter_vpost_bytes, and only set m_bHasLocalExposureParams / m_bHasFogScatteringParams when present in the stock resource.
  • Always append KV3_END_MARKER after the blob section in encode_kv3_v5 whenever count_blobs > 0.
  • Bump DeadlockPerfModPack::BrighterLighting builder version from "1" to "2" and flag older PerfMod versions as stale in load_deadlock_profile_detail_with_steam_in / reconcile_perf_mod_vpks so existing profiles offer a one-click rebuild.
  • Added unit tests for the 0-byte blob trailer, identity LUT output, and builder version rebuild path, and added a CHANGELOG.md entry.

Checks

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p execs-core --lib --locked deadlock:: (55/55 passing)
  • EXECS_REAL_DEADLOCK_ROOT=... cargo test -p execs-core --lib --locked verifies_all_perf_vpks_against_live_deadlock_install_readonly -- --ignored (27/27 stock .vpost_c decoded, all 5 packs built and verified)

@rndaom
rndaom merged commit 4a69886 into main Dec 6, 2026
11 checks passed
@rndaom
rndaom deleted the rndaom/deadlock-brighter-lighting-fix branch December 6, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant