summaryrefslogtreecommitdiffstats
path: root/CONTEXT.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 18:58:13 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 18:58:13 +0100
commit5ddc9eb9d02ddc84e4c3a45bdcb2941513fb0346 (patch)
treec83aa673488b0628e0f63cdc8b82e45c7693be9d /CONTEXT.md
parentChams: apply model-safe styles to the viewmodel (diff)
downloadhl2h-5ddc9eb9d02ddc84e4c3a45bdcb2941513fb0346.tar.gz
hl2h-5ddc9eb9d02ddc84e4c3a45bdcb2941513fb0346.zip
Chams: per-relationship, visible/invisible styles and viewmodel
- Hostile/neutral/friendly each have independent visible and through-wall settings: enable, style and colour. Viewmodel has its own enable/style/colour. - Styles: Flat, Wireframe, Additive, Solid, White, Fullbright, Glow outline. Additive uses the model solid material + ADDITIVE flag (the VGUI additive was invisible on NPCs). White/fullbright are solid-based, so the viewmodel no longer disappears/checkerboards. Glow outline adds a wireframe contour pass for depth. - Config: [chams] active/bind, [chams_hostile|neutral|friendly] vis/inv settings, [chams_vm]. GUI sections for each group.
Diffstat (limited to 'CONTEXT.md')
-rw-r--r--CONTEXT.md53
1 files changed, 24 insertions, 29 deletions
diff --git a/CONTEXT.md b/CONTEXT.md
index e323588..be526fc 100644
--- a/CONTEXT.md
+++ b/CONTEXT.md
@@ -285,35 +285,30 @@ vocabulary / decisions.
285## Chams 285## Chams
286 286
287- Hooks `IVModelRender::DrawModelExecute` (slot 19 in `VEngineModel016`). 287- Hooks `IVModelRender::DrawModelExecute` (slot 19 in `VEngineModel016`).
288 The model's entity is `ModelRenderInfo_t::entity_index` (32-bit offset 0x30); 288 The model's entity is `ModelRenderInfo_t::entity_index` (32-bit offset 0x30).
289 only entities for which `esp_is_npc_index` says the client class is an NPC 289 NPCs are grouped by `esp_npc_relation` (hostile / neutral / friendly);
290 are affected. 290 viewmodel entities (class contains `viewmodel` or model path `.../v_...`)
291- Uses `IVModelRender::ForcedMaterialOverride` (slot 1) with 291 are a fourth group.
292 `models/debug/debugwhite` and draws twice: first with 292- Each relationship has independent **visible** and **through-wall** settings:
293 `MATERIAL_VAR_IGNOREZ` (1 << 15) set through `IMaterial::SetMaterialVarFlag` 293 on/off, style, and colour. The viewmodel has on/off, style and colour only.
294 (slot 29) for the through-wall pass, then without it. Colour is applied via 294 The through-wall pass uses `MATERIAL_VAR_IGNOREZ` (1 << 15) through
295 `IMaterial::ColorModulate` (slot 28) **and** the shader's `$color`/`$color2` 295 `IMaterial::SetMaterialVarFlag` (slot 29); colours use `$color`/`$color2`
296 vars (IMaterialVar slot 11, SetVecValue 3-float slot 11), because some forced 296 (IMaterialVar slot 11, SetVecValue 3-float slot 11) and `ColorModulate`
297 materials ignore ColorModulate. The shared material's flag and colour are 297 (slot 28). Shared materials are restored after each draw.
298 restored to (false, white) after the draw. 298- Styles are built from the resident materials and material flags:
299- The base game does not mount `models/debug/debugwhite` (EP2-only) or 299 0 Flat (`vgui/white` with FLAT), 1 Wireframe (`debug/debugwireframe`),
300 `debug/additivevertexcolorvertexalpha`; the style material is preloaded from 300 2 Additive (`debug/debugtranslucentsinglecolor` + ADDITIVE), 3 Solid,
301 `outer_draw` (throttled) and cached. Styles: 0 Flat (`vgui/white`), 301 4 White (solid, colour forced white), 5 Fullbright (solid + FLAT|SELFILLUM),
302 1 Wireframe (`debug/debugwireframe`), 2 Additive (`vgui/white_additive`), 302 6 Glow outline (solid plus a `debug/debugwireframe` contour pass).
303 3 Solid (`debug/debugtranslucentsinglecolor`), 4 White 303 `models/debug/debugwhite` is EP2-only and the old VGUI additive material is
304 (`debug/debugtranslucentvertexcolor`), 5 Fullbright 304 invisible on NPCs; the styles no longer depend on them.
305 (`debug/debugmrmfullbright2`). A missing style falls back to the solid one; 305- Style materials are preloaded from `outer_draw` (throttled) and cached; the
306 the render hook never calls FindMaterial itself. 306 render hook never calls FindMaterial itself. A missing style uses solid.
307- `Viewmodel (hands/weapon)` applies the override to entities whose class 307- Feature is off by default. Config sections: `[chams]` (active/bind),
308 contains `viewmodel` or whose model path is `.../v_...`. Viewmodels always 308 `[chams_hostile|neutral|friendly]` (`vis`, `vis_mat`, `vis_r/g/b`, `inv`,
309 use the solid style (no style flags) with the selected colour; VGUI/white 309 `inv_mat`, `inv_r/g/b`) and `[chams_vm]` (`on`, `mat`, `r/g/b`). The GUI has
310 materials do not draw skinned models and made the hands/weapon disappear. 310 a Hostile/Neutral/Friendly section each, plus Viewmodel.
311 Only the normal-depth pass is used. 311- This is a material override, not stencil outlines.
312- Feature is off by default; `[chams] active/bind/walls/viewmodel/material/r/g/b`,
313 with Through walls, Viewmodel, a Material dropdown and colour in the Visuals
314 card.
315- This is a flat material override, not stencil outlines; depth handling is
316 the simple ignorez/normal two-pass.
317 312
318## Bones / ESP 313## Bones / ESP
319 314