From 49df428d95a7c443d418d5b7e2a93af599b54f76 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 17:51:20 +0100 Subject: Add chams - Hook IVModelRender::DrawModelExecute (VEngineModel016 slot 19) and force models/debug/debugwhite for NPC models, identified by ModelRenderInfo_t::entity_index. - Two passes: MATERIAL_VAR_IGNOREZ through walls, then normal depth, with IMaterial::ColorModulate for the configured colour; restore the shared material's flag/colour afterwards. - Material lookup via the IMaterialSystem list, FindMaterial fallback. - New Chams feature/card with Through walls and colour; [chams] config. - Remove the temporary ammo/projectile/fuse diagnostics. --- CONTEXT.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'CONTEXT.md') diff --git a/CONTEXT.md b/CONTEXT.md index 92094bc..1fe24a0 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -278,6 +278,25 @@ vocabulary / decisions. visible corner. Each edge is clipped at the camera near plane and then to the screen, so a box straddling the camera still draws its visible portions. +## Chams + +- Hooks `IVModelRender::DrawModelExecute` (slot 19 in `VEngineModel016`). + The model's entity is `ModelRenderInfo_t::entity_index` (32-bit offset 0x30); + only entities for which `esp_is_npc_index` says the client class is an NPC + are affected. +- Uses `IVModelRender::ForcedMaterialOverride` (slot 1) with + `models/debug/debugwhite` and draws twice: first with + `MATERIAL_VAR_IGNOREZ` (1 << 15) set through `IMaterial::SetMaterialVarFlag` + (slot 29) for the through-wall pass, then without it. `IMaterial:: + ColorModulate` (slot 28) applies the configured colour. The shared material's + flag and colour are restored to (false, white) after the draw. +- Material lookup walks the `IMaterialSystem` list (`world_find_material`), with + `FindMaterial` (slot 71) as the fallback for a not-yet-resident material. +- Feature is off by default; `[chams] active/bind/walls/r/g/b`, with a + "Through walls" toggle and colour picker in the Visuals card. +- This is a flat material override, not stencil outlines; depth handling is + the simple ignorez/normal two-pass. + ## Bones / ESP - `SetupBones(BONE_USED_BY_ANYTHING)` with engine `Time()`; studio header via -- cgit v1.2.3