From 8a5efe20e6e077e10592aa427d704836d2a08dd1 Mon Sep 17 00:00:00 2001 From: salmonik Date: Fri, 6 Nov 2026 16:17:02 +0100 Subject: Chams: leave engine-forced material passes alone Shadow-depth and reflection passes call DrawModelExecute with a material already forced via IVModelRender::ForcedMaterialOverride. Chams could not tell that apart from a free draw, substituted its own material (putting chams into the shadow map) and then cleared the override to null, which broke the shadow material for every model drawn afterwards. Hook slot 1 as a tracker so the current forced material is known, and skip the chams substitution whenever one is active. --- FIX_PLAN.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'FIX_PLAN.md') diff --git a/FIX_PLAN.md b/FIX_PLAN.md index e4e149e..2c84122 100644 --- a/FIX_PLAN.md +++ b/FIX_PLAN.md @@ -778,6 +778,16 @@ Caches are cleared by `esp_reset_session()` on map change/respawn. The ESP scan itself is unchanged: projection only happens for the handful of entities that survive the class/life/friendly filters, not for every entity. +### Batch 5 — chams shadow passes + +`IVModelRender::ForcedMaterialOverride` (slot 1) is now hooked as well, purely +to track the engine's current forced material. `DrawModelExecute` skips chams +when an override is already active, so shadow-depth and reflection passes draw +with their own material instead of being substituted with chams and then having +the engine's override cleared for every model drawn afterwards. This is the fix +for the corruption described in P2-6; it needs an in-game check because it +relies on the engine always going through the vtable for that call. + ### Known remaining work Deliberately deferred, with reasons: @@ -787,9 +797,6 @@ Deliberately deferred, with reasons: slot plus a way to get the networkable from a raw entity pointer, or a cached pointer→index map. Not worth the risk for a hot path that fires a few times per second. -- **P2-6 shadow-depth `ForcedMaterialOverride`** — requires reading the - engine's current override, which VEngineModel016 does not expose. Needs an - alternative detection (draw flags in `DrawModelState_t`) validated in-game. - **P3-2 declarative settings table** — large rewrite of `config_save`, `config_load`, `config_reset_defaults` and `build_cards`. It can regress config persistence, so it should follow an in-game pass. -- cgit v1.2.3