summaryrefslogtreecommitdiffstats
path: root/src/hl2h.cpp
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 22:09:14 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 22:09:14 +0100
commit0cbcbfc14997eff39e0c76acf30c48b851ed1f62 (patch)
tree19a5b0996bdf9e096f79e9636ebb48b57e10e643 /src/hl2h.cpp
parentChams: real additive material, addref cached materials (diff)
downloadhl2h-0cbcbfc14997eff39e0c76acf30c48b851ed1f62.tar.gz
hl2h-0cbcbfc14997eff39e0c76acf30c48b851ed1f62.zip
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 <game>/<mod>/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.
Diffstat (limited to '')
-rw-r--r--src/hl2h.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/hl2h.cpp b/src/hl2h.cpp
index 067b11f..ddfc02a 100644
--- a/src/hl2h.cpp
+++ b/src/hl2h.cpp
@@ -1149,6 +1149,7 @@ static void *setup_thread(void *) {
1149 g_iface.debugoverlay = ef("VDebugOverlay003", nullptr); 1149 g_iface.debugoverlay = ef("VDebugOverlay003", nullptr);
1150 g_iface.enginetrace = ef("EngineTraceClient003", nullptr); 1150 g_iface.enginetrace = ef("EngineTraceClient003", nullptr);
1151 g_iface.modelrender = ef("VEngineModel016", nullptr); 1151 g_iface.modelrender = ef("VEngineModel016", nullptr);
1152 g_iface.renderview = ef("VEngineRenderView014", nullptr);
1152 static const char *cvar_names[] = {"VEngineCvar004", "VEngineCvar007", 1153 static const char *cvar_names[] = {"VEngineCvar004", "VEngineCvar007",
1153 "VEngineCvar003", "IVEngineCvar004", 1154 "VEngineCvar003", "IVEngineCvar004",
1154 nullptr}; 1155 nullptr};