From ccd5256bfacf27ed81fbf13087ba04978d6913f8 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 18:03:09 +0100 Subject: Chams: tint through $color/$color2 and log the chosen material ColorModulate alone left the forced material white. Also set the shader's $color and $color2 vars (IMaterialVar SetVecValue 3-float) and restore them to white after the draw. Log which fallback material was selected. --- CONTEXT.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'CONTEXT.md') diff --git a/CONTEXT.md b/CONTEXT.md index 1fe24a0..60a5a91 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -287,11 +287,16 @@ vocabulary / decisions. - 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. + (slot 29) for the through-wall pass, then without it. Colour is applied via + `IMaterial::ColorModulate` (slot 28) **and** the shader's `$color`/`$color2` + vars (IMaterialVar slot 11, SetVecValue 3-float slot 11), because some forced + materials ignore ColorModulate. 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. + `FindMaterial` (slot 71) as the fallback. Candidates, in order: + `models/debug/debugwhite{2,3}`, `vgui/white`, + `debug/debugtranslucentsinglecolor`, `debug/debugwireframevertexcolorignorez`. + The chosen material name is logged. - 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 -- cgit v1.2.3