From 0cbcbfc14997eff39e0c76acf30c48b851ed1f62 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 22:09:14 +0100 Subject: Chams: working alpha via RenderView blend and a custom VMT Testing on :99 showed the material $alpha path is a dead end: UnlitGeneric takes translucency from the base texture/vertex alpha, and the debug materials have neither. Follow Amalgam: apply alpha with IVRenderView::SetBlend (VEngineRenderView014 slot 4) around the model draw, saving/restoring it. To have something translucent to blend, write a tiny UnlitGeneric VMT with $model 1 + $translucent 1 + a white base texture to //materials/hl2hake/translucent.vmt (plus a custom/ copy). It is written by a preload constructor so it exists before the material system scans its search paths, then loaded once with FindMaterial. Styles 0/3/4/6 use it when the colour alpha is below 255. Also: - Visible wireframe + through-wall: fill the visible silhouette first so the through-wall pass cannot show in the wireframe gaps, then draw a brightened contour. Style 6 is now "Solid + contour" (recolour + visible edges). - find_modules builds local snapshots and publishes them under a mutex; the setup thread and the server retry could reset the shared vectors live and crash at startup. Verified on :99: Solid + alpha 64 renders a see-through viewmodel, Solid + contour shows a blue fill with bright blue contours, Additive is a translucent coloured glow and Fullbright is a white additive glow. --- src/gui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui.cpp') diff --git a/src/gui.cpp b/src/gui.cpp index 89888da..fe82762 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -459,7 +459,7 @@ static void build_cards() { "Per-relationship model colours.", true); static const char *const chams_mat_names[] = { "Flat", "Wireframe", "Additive glow", "Solid", "White", "Fullbright", - "Glow outline"}; + "Solid + contour"}; auto add_chams_group = [&](const char *title, ChamsGroup &g) { add_section(chams, title); add_toggle(chams, "Visible", "Draw the normal-depth pass.", -- cgit v1.2.3