summaryrefslogtreecommitdiffstats
path: root/src/studio.cpp
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 19:09:31 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 19:09:31 +0100
commitc15a74d39f87c73a35ca420450e2876db2c37deb (patch)
tree288cfd29e66d64dcbb58418e657dec9773648a16 /src/studio.cpp
parentChams: fix the flat viewmodel, glow outline and fullbright styles (diff)
downloadhl2h-c15a74d39f87c73a35ca420450e2876db2c37deb.tar.gz
hl2h-c15a74d39f87c73a35ca420450e2876db2c37deb.zip
Chams: use the model solid shader for flat, drop vgui/white
vgui/white is an UnlitGeneric with $vertexcolor/$vertexalpha, no basetexture and no $model, so it renders nothing on model vertices; Flat was invisible on the viewmodel and would be invisible on NPCs too. Flat now uses the solid model shader with the FLAT flag. Remove the vgui/white probe.
Diffstat (limited to 'src/studio.cpp')
-rw-r--r--src/studio.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/studio.cpp b/src/studio.cpp
index 301e781..4941142 100644
--- a/src/studio.cpp
+++ b/src/studio.cpp
@@ -208,8 +208,8 @@ const char *chams_material_name(int idx) {
208 case 3: 208 case 3:
209 case 4: 209 case 4:
210 case 5: 210 case 5:
211 case 6: return "debug/debugtranslucentsinglecolor"; 211 case 6:
212 default: return "vgui/white"; // models/debug/debugwhite is EP2-only 212 default: return "debug/debugtranslucentsinglecolor";
213 } 213 }
214} 214}
215 215
@@ -300,10 +300,6 @@ void hkdModelExecute(void *self, const void *state, const void *info,
300 if (style < 0) style = 0; 300 if (style < 0) style = 0;
301 if (style > 6) style = 6; 301 if (style > 6) style = 6;
302 void *mat = style_material(style); 302 void *mat = style_material(style);
303 // vgui/white (Flat) does not draw skinned models, so the viewmodel
304 // uses the solid model shader with the same FLAT flag.
305 if (is_vm && style == 0)
306 mat = viewmodel_material();
307 if (!mat) 303 if (!mat)
308 return false; 304 return false;
309 bool white = style == 4; 305 bool white = style == 4;
@@ -367,16 +363,10 @@ static double chams_now() {
367// the style VMTs. The render hook only reads the cached pointers. 363// the style VMTs. The render hook only reads the cached pointers.
368void chams_preload() { 364void chams_preload() {
369 static double last = 0.0; 365 static double last = 0.0;
370 static bool probed = false;
371 double now = chams_now(); 366 double now = chams_now();
372 if (now - last < 1.5) 367 if (now - last < 1.5)
373 return; 368 return;
374 last = now; 369 last = now;
375 if (!probed) {
376 probed = true;
377 void *probe = world_find_material("vgui/white");
378 logf("chams: probe vgui/white = %p", probe);
379 }
380 for (int i = 0; i < 7; i++) { 370 for (int i = 0; i < 7; i++) {
381 if (g_style_mats[i]) 371 if (g_style_mats[i])
382 continue; 372 continue;