From b661a8dfd2c02bea54d8581ebb35d0fb3267867c Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 19:36:24 +0100 Subject: Chams: per-colour alpha and a softer viewmodel additive base - Colour picker gains an optional alpha bar (checkerboard preview, #RRGGBBAA readout); add_color_alpha is used for the chams colours. Chams colours are now r,g,b,a and chams_apply sets $alpha plus MATERIAL_VAR_TRANSLUCENT when alpha < 255. Config stores vis_a / inv_a / vm a. - The additive viewmodel base is now a faint translucent tint (alpha/8) instead of an opaque fill, so additive/Fullbright stay see-through and the viewmodel no longer becomes a solid blob. Fullbright whitening reduced to 25% so blue stays blue instead of turning lavender. --- CONTEXT.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'CONTEXT.md') diff --git a/CONTEXT.md b/CONTEXT.md index c75e36c..1bb0a6a 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -290,11 +290,16 @@ vocabulary / decisions. viewmodel entities (class contains `viewmodel` or model path `.../v_...`) are a fourth group. - Each relationship has independent **visible** and **through-wall** settings: - on/off, style, and colour. The viewmodel has on/off, style and colour only. - The through-wall pass uses `MATERIAL_VAR_IGNOREZ` (1 << 15) through - `IMaterial::SetMaterialVarFlag` (slot 29); colours use `$color`/`$color2` - (IMaterialVar slot 11, SetVecValue 3-float slot 11) and `ColorModulate` - (slot 28). Shared materials are restored after each draw. + on/off, style, colour and alpha. The viewmodel has on/off, style, colour and + alpha only. The through-wall pass uses `MATERIAL_VAR_IGNOREZ` (1 << 15) + through `IMaterial::SetMaterialVarFlag` (slot 29); colours use + `$color`/`$color2` (IMaterialVar slot 11, SetVecValue 3-float slot 11) and + `ColorModulate` (slot 28). Alpha uses `$alpha` (IMaterialVar slot 3, + SetFloatValue) and `MATERIAL_VAR_TRANSLUCENT` (1 << 21) when alpha < 255. + Shared materials are restored after each draw. +- The GUI colour picker (`add_color_alpha`) has an alpha bar, checkerboard + preview and `#RRGGBBAA` readout; plain `add_color` keeps the old opaque + three-component behaviour. Chams colours are four ints (r, g, b, a). - Styles are built from `debug/debugtranslucentsinglecolor` (UnlitGeneric, `$color`) and material flags: 0 Flat (solid + FLAT), 1 Wireframe (`debug/debugwireframe`), 2 Additive @@ -310,12 +315,13 @@ vocabulary / decisions. - Viewmodels are collated by the engine as `RENDER_GROUP_VIEW_MODEL_OPAQUE`, so an additive forced material can wash out against a bright sky or wall (and the engine may not treat the draw as translucent). Additive styles on - the viewmodel therefore draw a dim opaque solid base first, then the - additive pass; the first-person model never disappears. + the viewmodel therefore draw a faint translucent base (alpha/8) first, then + the additive pass, so the model keeps a silhouette on bright backgrounds + without becoming an opaque blob. - Feature is off by default. Config sections: `[chams]` (active/bind), - `[chams_hostile|neutral|friendly]` (`vis`, `vis_mat`, `vis_r/g/b`, `inv`, - `inv_mat`, `inv_r/g/b`) and `[chams_vm]` (`on`, `mat`, `r/g/b`). The GUI has - a Hostile/Neutral/Friendly section each, plus Viewmodel. + `[chams_hostile|neutral|friendly]` (`vis`, `vis_mat`, `vis_r/g/b/a`, `inv`, + `inv_mat`, `inv_r/g/b/a`) and `[chams_vm]` (`on`, `mat`, `r/g/b/a`). The GUI + has a Hostile/Neutral/Friendly section each, plus Viewmodel. - This is a material override, not stencil outlines. ## Bones / ESP -- cgit v1.2.3