ui(jets): gray out Strength + hint when spin is below the render gate
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.
This commit is contained in:
parent
38d4bd00f2
commit
934468f7a0
13
src/ui.rs
13
src/ui.rs
@ -83,7 +83,18 @@ pub fn ui_system(
|
|||||||
});
|
});
|
||||||
egui::CollapsingHeader::new("Jets").show(ui, |ui| {
|
egui::CollapsingHeader::new("Jets").show(ui, |ui| {
|
||||||
ui.checkbox(&mut params.jets_enabled, "Enabled");
|
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| {
|
egui::CollapsingHeader::new("Renderer").show(ui, |ui| {
|
||||||
ui.add(egui::Slider::new(&mut params.steps, 50..=600).text("Steps"));
|
ui.add(egui::Slider::new(&mut params.steps, 50..=600).text("Steps"));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user