From bfd2f7fac43069d29436d4ecf3767b2c57f59c3a Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 18:46:46 +0100 Subject: Chams: use the loaded VGUI whites for flat and additive models/debug/debugwhite is EP2-only and additivevertexcolorvertexalpha is not loadable in the base game. Preload vgui/white for Flat and vgui/white_additive for Additive; the other debug styles were already found. The viewmodel keeps the solid model shader. --- CONTEXT.md | 14 ++++++++------ src/studio.cpp | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CONTEXT.md b/CONTEXT.md index 72559ac..e323588 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -296,12 +296,14 @@ vocabulary / decisions. 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. -- The base game does not have the other debug VMTs resident and `FindMaterial` - does not make them available reliably, so all styles use the resident - `debug/debugtranslucentsinglecolor` and differ by material flags: - 0 Flat (`FLAT`), 1 Wireframe (`WIREFRAME`), 2 Additive (`ADDITIVE`), - 3 Solid (none), 4 White (colour forced to white), 5 Fullbright - (`FLAT|SELFILLUM`). Flags are reset after the draw. +- The base game does not mount `models/debug/debugwhite` (EP2-only) or + `debug/additivevertexcolorvertexalpha`; the style material is preloaded from + `outer_draw` (throttled) and cached. Styles: 0 Flat (`vgui/white`), + 1 Wireframe (`debug/debugwireframe`), 2 Additive (`vgui/white_additive`), + 3 Solid (`debug/debugtranslucentsinglecolor`), 4 White + (`debug/debugtranslucentvertexcolor`), 5 Fullbright + (`debug/debugmrmfullbright2`). A missing style falls back to the solid one; + the render hook never calls FindMaterial itself. - `Viewmodel (hands/weapon)` applies the override to entities whose class contains `viewmodel` or whose model path is `.../v_...`. Viewmodels always use the solid style (no style flags) with the selected colour; VGUI/white diff --git a/src/studio.cpp b/src/studio.cpp index 44d1bb4..f815c16 100644 --- a/src/studio.cpp +++ b/src/studio.cpp @@ -204,11 +204,11 @@ void *viewmodel_material(); const char *chams_material_name(int idx) { switch (idx) { case 1: return "debug/debugwireframe"; - case 2: return "debug/additivevertexcolorvertexalpha"; + case 2: return "vgui/white_additive"; case 3: return "debug/debugtranslucentsinglecolor"; case 4: return "debug/debugtranslucentvertexcolor"; case 5: return "debug/debugmrmfullbright2"; - default: return "models/debug/debugwhite"; + default: return "vgui/white"; // models/debug/debugwhite is EP2-only } } -- cgit v1.2.3