summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/studio.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/studio.cpp b/src/studio.cpp
index 4941142..bee6db5 100644
--- a/src/studio.cpp
+++ b/src/studio.cpp
@@ -313,6 +313,18 @@ void hkdModelExecute(void *self, const void *state, const void *info,
313 brgb[i] = rgb[i] + (255 - rgb[i]) / 2; 313 brgb[i] = rgb[i] + (255 - rgb[i]) / 2;
314 use_rgb = brgb; 314 use_rgb = brgb;
315 } 315 }
316 // Additive blending vanishes against bright backgrounds (sky,
317 // white walls, strong fog), which made the viewmodel disappear in
318 // some places. Lay down a dim opaque base first so the first-person
319 // model always has a visible silhouette; the additive pass still
320 // adds the glow on top.
321 if (is_vm && (style == 2 || style == 5)) {
322 int drgb[3] = {rgb[0] / 2, rgb[1] / 2, rgb[2] / 2};
323 chams_apply(mat, ignorez, 3, false, drgb, false);
324 g_force_override(self, mat, 0 /* OVERRIDE_NORMAL */);
325 g_orig_model_exec(self, state, info, bone);
326 chams_reset(mat);
327 }
316 chams_apply(mat, ignorez, style, white, use_rgb, false); 328 chams_apply(mat, ignorez, style, white, use_rgb, false);
317 g_force_override(self, mat, 0 /* OVERRIDE_NORMAL */); 329 g_force_override(self, mat, 0 /* OVERRIDE_NORMAL */);
318 g_orig_model_exec(self, state, info, bone); 330 g_orig_model_exec(self, state, info, bone);