diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 19:39:27 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 19:39:27 +0100 |
| commit | 86093c9052db0aec19f9d993dc59dc5259d085bb (patch) | |
| tree | bf01d0e15ee4f64f8debe8db9503c50de91499ad | |
| parent | Chams: per-colour alpha and a softer viewmodel additive base (diff) | |
| download | hl2h-86093c9052db0aec19f9d993dc59dc5259d085bb.tar.gz hl2h-86093c9052db0aec19f9d993dc59dc5259d085bb.zip | |
Chams: make Fullbright a white-hot additive glow
Fullbright was additive with the chosen colour lifted only 25% toward white,
which on a dark scene looked almost identical to Solid/Flat. Force white for
the Fullbright colour so the additive pass reads as a distinctly brighter,
white-hot glow; the faint translucent base still gives it a silhouette on
bright backgrounds.
| -rw-r--r-- | CONTEXT.md | 3 | ||||
| -rw-r--r-- | src/studio.cpp | 12 |
2 files changed, 3 insertions, 12 deletions
| @@ -304,7 +304,8 @@ vocabulary / decisions. | |||
| 304 | `$color`) and material flags: | 304 | `$color`) and material flags: |
| 305 | 0 Flat (solid + FLAT), 1 Wireframe (`debug/debugwireframe`), 2 Additive | 305 | 0 Flat (solid + FLAT), 1 Wireframe (`debug/debugwireframe`), 2 Additive |
| 306 | (+ ADDITIVE), 3 Solid, 4 White (colour forced white), 5 Fullbright | 306 | (+ ADDITIVE), 3 Solid, 4 White (colour forced white), 5 Fullbright |
| 307 | (ADDITIVE|SELFILLUM with the colour lifted toward white), 6 Glow outline | 307 | (ADDITIVE|SELFILLUM, colour forced white so it reads as a white-hot glow |
| 308 | instead of matching Solid), 6 Glow outline | ||
| 308 | (solid plus a `debug/debugwireframe` contour pass drawn with ZNEARER | 309 | (solid plus a `debug/debugwireframe` contour pass drawn with ZNEARER |
| 309 | (1 << 10) and a brightened colour so the base cannot bury it). | 310 | (1 << 10) and a brightened colour so the base cannot bury it). |
| 310 | `vgui/white` is vertex-colour based and has no `$model`/`$basetexture`, so it | 311 | `vgui/white` is vertex-colour based and has no `$model`/`$basetexture`, so it |
diff --git a/src/studio.cpp b/src/studio.cpp index 07ebec3..086d213 100644 --- a/src/studio.cpp +++ b/src/studio.cpp | |||
| @@ -315,18 +315,8 @@ void hkdModelExecute(void *self, const void *state, const void *info, | |||
| 315 | void *mat = style_material(style); | 315 | void *mat = style_material(style); |
| 316 | if (!mat) | 316 | if (!mat) |
| 317 | return false; | 317 | return false; |
| 318 | bool white = style == 4; | 318 | bool white = style == 4 || style == 5; |
| 319 | // Fullbright is an additive, self-illuminated version of the | ||
| 320 | // chosen colour: lift it toward white so it reads brighter than | ||
| 321 | // the plain additive style. | ||
| 322 | int brgb[4]; | ||
| 323 | const int *use_rgb = rgb; | 319 | const int *use_rgb = rgb; |
| 324 | if (style == 5) { | ||
| 325 | for (int i = 0; i < 3; i++) | ||
| 326 | brgb[i] = rgb[i] + (255 - rgb[i]) / 4; | ||
| 327 | brgb[3] = rgb[3]; | ||
| 328 | use_rgb = brgb; | ||
| 329 | } | ||
| 330 | // Additive blending vanishes against bright backgrounds (sky, | 320 | // Additive blending vanishes against bright backgrounds (sky, |
| 331 | // white walls, strong fog), which made the viewmodel disappear in | 321 | // white walls, strong fog), which made the viewmodel disappear in |
| 332 | // some places. Lay down a faint translucent base so the first-person | 322 | // some places. Lay down a faint translucent base so the first-person |
