From 934468f7a0b5b09c5c70478ee9e982d95e6b0bd7 Mon Sep 17 00:00:00 2001 From: xfy Date: Thu, 16 Jul 2026 14:11:02 +0800 Subject: [PATCH] ui(jets): gray out Strength + hint when spin is below the render gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sample_jets suppresses jets for χ < 0.05 (previous commit), but the egui panel's checkbox still flipped freely and Strength stayed editable at low spin, so enabling jets there did nothing with no explanation — the toggle looked broken. Mirror the shader's gate in the UI: keep the Enabled checkbox interactive (it expresses user intent), gray out Strength when jets won't render (matching the existing pattern used for disk quality, Doppler, color model, and bloom), and show a one-line hint ("Spin (χ) too low — jets need χ ≥ 0.05.") so the no-op is self-documenting. --- src/ui.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ui.rs b/src/ui.rs index 49151cc..da671ab 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -83,7 +83,18 @@ pub fn ui_system( }); egui::CollapsingHeader::new("Jets").show(ui, |ui| { ui.checkbox(&mut params.jets_enabled, "Enabled"); - ui.add_enabled(params.jets_enabled, egui::Slider::new(&mut params.jets_strength, 0.0..=3.0).text("Strength")); + // Mirror the shader's spin gate (sample_jets in black_hole.wgsl): + // jets are a spin-powered (Blandford-Znajek) outflow and render + // only for χ ≥ 0.05. When the user enables them at low spin, + // explain the no-op so the checkbox doesn't look broken. + let jets_renderable = params.spin >= 0.05; + if params.jets_enabled && !jets_renderable { + ui.label("Spin (χ) too low — jets need χ ≥ 0.05."); + } + ui.add_enabled( + params.jets_enabled && jets_renderable, + egui::Slider::new(&mut params.jets_strength, 0.0..=3.0).text("Strength"), + ); }); egui::CollapsingHeader::new("Renderer").show(ui, |ui| { ui.add(egui::Slider::new(&mut params.steps, 50..=600).text("Steps"));