From edba65625dd5823705619a2e682a99d6ad91ae8b Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 3 Nov 2026 23:32:16 +0100 Subject: World: add prop tint and fog override - World tint now also colours prop materials (models/props*) with their own colour, covering static props and prop_physics while leaving NPC, player and weapon materials untouched. - New Fog card: fog_override colour/start/end via ClientCmd, optional skybox fog, and a Remove fog mode. Restores the map fog (fog_override 0) when disabled and re-applies after level changes. - Config sections [worldtint] prop/colour keys and [fog]. --- CONTEXT.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'CONTEXT.md') diff --git a/CONTEXT.md b/CONTEXT.md index b48100b..1d365e8 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -316,8 +316,11 @@ vocabulary / decisions. already-loaded `materialsystem.so` and walk every material with `FirstMaterial` / `NextMaterial` / `GetMaterial`. - `IMaterial::ColorModulate(r,g,b)` is applied to materials whose - `GetTextureGroupName()` is `World textures` (sky names excluded) and to - `SkyBox textures` (or names containing `sky`). Lightmaps are not touched. + `GetTextureGroupName()` is `World textures` (sky names excluded), to + `SkyBox textures` (or names containing `sky`), and to prop materials whose + name starts with `models/props` (static props and prop_physics share those + model materials; NPC/player/weapon materials are excluded). Lightmaps are + not touched. - Slot map (2013 SDK layout, registered under `VMaterialSystem080`): `IMaterialSystem` 73/74/75/76/77 = First/Next/Invalid/Get/GetNumMaterials; `IMaterial` 0/1/28 = GetName/GetTextureGroupName/ColorModulate. @@ -327,7 +330,24 @@ vocabulary / decisions. - Validation before any walk: `GetNumMaterials()` must return 1..200000; the first material's name/group must be printable strings. A mismatch logs and toasts instead of poking garbage. -- Saved as `[worldtint] active/bind/world/sky/wr..wb/sr..sb`. +- Saved as `[worldtint] active/bind/world/sky/prop/wr..pb`. +- Particle tint is deliberately not implemented: HL2's old particle manager + draws per-vertex coloured IMesh quads, and SpriteCard/TF2-style particles + take colour from per-particle vertex data, so `IMaterial::ColorModulate` + does nothing for them. It needs a hook in the client particle render path. + +### Fog + +- `src/world.cpp` `fog_update()`, driven by the `fog_override` engine command + family through `IVEngineClient::ClientCmd` (same safe path as fullbright). + No render hooks. +- Enabled: `fog_override 1`, `fog_enable 1`, `fog_color`, `fog_start`, + `fog_end`, plus `fog_enableskybox` / `fog_colorskybox` / + `fog_startskybox` / `fog_endskybox` when skybox fog is on. + "Remove fog" issues `fog_enable 0` instead. +- Disabled: `fog_override 0` restores the map's own fog controller. +- End is clamped above Start. Re-applied on level change via + `fog_invalidate()`. Saved as `[fog] active/bind/r/g/b/start/end/skybox/disable`. ## Logging -- cgit v1.2.3