From 5ddc9eb9d02ddc84e4c3a45bdcb2941513fb0346 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 18:58:13 +0100 Subject: Chams: per-relationship, visible/invisible styles and viewmodel - Hostile/neutral/friendly each have independent visible and through-wall settings: enable, style and colour. Viewmodel has its own enable/style/colour. - Styles: Flat, Wireframe, Additive, Solid, White, Fullbright, Glow outline. Additive uses the model solid material + ADDITIVE flag (the VGUI additive was invisible on NPCs). White/fullbright are solid-based, so the viewmodel no longer disappears/checkerboards. Glow outline adds a wireframe contour pass for depth. - Config: [chams] active/bind, [chams_hostile|neutral|friendly] vis/inv settings, [chams_vm]. GUI sections for each group. --- src/gui.cpp | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) (limited to 'src/gui.cpp') diff --git a/src/gui.cpp b/src/gui.cpp index 9c09bec..3cbb40a 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -446,18 +446,37 @@ static void build_cards() { "Draw the projectile's damage radius on the ground.", &g_proj_radius); int chams = add_card(2, &g_chams, "Chams", - "Flat-colour NPC models.", true); - add_toggle(chams, "Through walls", - "Draw a second pass with the depth test disabled.", - &g_chams_walls); + "Per-relationship model colours.", true); + static const char *const chams_mat_names[] = { + "Flat", "Wireframe", "Additive glow", "Solid", "White", "Fullbright", + "Glow outline"}; + auto add_chams_group = [&](const char *title, ChamsGroup &g) { + add_section(chams, title); + add_toggle(chams, "Visible", "Draw the normal-depth pass.", + &g.vis_on); + add_dropdown(chams, "Visible material", "Material for the visible pass.", + chams_mat_names, 7, &g.vis_mat); + add_color(chams, "Visible colour", "Colour for the visible pass.", + g.vis_rgb); + add_toggle(chams, "Through walls", "Draw a pass with the depth test off.", + &g.inv_on); + add_dropdown(chams, "Invisible material", + "Material for the through-wall pass.", chams_mat_names, 7, + &g.inv_mat); + add_color(chams, "Invisible colour", + "Colour for the through-wall pass.", g.inv_rgb); + }; + add_chams_group("Hostile", g_chams_hostile); + add_chams_group("Neutral", g_chams_neutral); + add_chams_group("Friendly", g_chams_friendly); + add_section(chams, "Viewmodel"); add_toggle(chams, "Viewmodel (hands/weapon)", - "Apply chams to the first-person hands and weapon too.", + "Apply chams to the first-person hands and weapon.", &g_chams_viewmodel); - static const char *const chams_mat_names[] = { - "Flat", "Wireframe", "Additive glow", "Solid", "White", "Fullbright"}; - add_dropdown(chams, "Material", "Chams material.", chams_mat_names, 6, - &g_chams_mat_index); - add_color(chams, "Colour", "Chams colour.", g_chams_rgb); + add_dropdown(chams, "Viewmodel material", "Material for the viewmodel.", + chams_mat_names, 7, &g_chams_vm_mat); + add_color(chams, "Viewmodel colour", "Colour for the viewmodel.", + g_chams_vm_rgb); int view = add_card(2, nullptr, "Camera / display", "Camera FOV, viewmodel FOV and HDR brightness.", true); add_slider(view, "Camera FOV", -- cgit v1.2.3