From 2bf925678d57df129f562b8718ecd2ad822dea39 Mon Sep 17 00:00:00 2001 From: pkuzic Date: Fri, 25 Sep 2026 10:43:03 +0100 Subject: [PATCH] MONKEY (fog): tune Modern after captures; fog-vista scenarios; consume-set allow-list Sun-fog strength 0.25 / angle 0.4 / lean 0.4, end-fog lean 0.25: the first pass turned dusk ridges into flat orange cut-outs against a blue sky. The dome's low band now MIXES toward the far fog colour by 15 deg (an offset over-pushed an already warm dusk ring). update_fog_model joins the ordering test's ALLOWED list (it runs in the resolve set, after it). Co-Authored-By: Claude Opus 5.5 --- crates/benilla-app/src/capture/scenarios.rs | 17 +++++++++++++++++ crates/benilla-assets/src/shaders/fog_hook.wgsl | 7 ++++--- crates/benilla-world/src/lighting/fog_model.rs | 8 ++++---- crates/benilla-world/src/lighting/mod.rs | 5 +++++ 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/crates/benilla-app/src/capture/scenarios.rs b/crates/benilla-app/src/capture/scenarios.rs index cefcb9a3..30277c7f 100644 --- a/crates/benilla-app/src/capture/scenarios.rs +++ b/crates/benilla-app/src/capture/scenarios.rs @@ -1389,6 +1389,23 @@ pub(super) const ON_DEMAND: &[Scenario] = &[ minute: 720, ui: None, }, + // MONKEY (fog): a long Elwynn vista from the Northshire ridge south over Goldshire's forest. + Scenario { + name: "fog-vista-noon", + map: Some(MAP_AZEROTH), + eye: [-9000.0, -100.0, 200.0], + look: [-9500.0, -100.0, 90.0], + minute: 720, + ui: None, + }, + Scenario { + name: "fog-vista-dusk", + map: Some(MAP_AZEROTH), + eye: [-9000.0, -100.0, 200.0], + look: [-9500.0, -100.0, 90.0], + minute: 1170, + ui: None, + }, Scenario { name: "fog-duskwood-dusk", map: Some(MAP_AZEROTH), diff --git a/crates/benilla-assets/src/shaders/fog_hook.wgsl b/crates/benilla-assets/src/shaders/fog_hook.wgsl index c9d66bac..d521d45f 100644 --- a/crates/benilla-assets/src/shaders/fog_hook.wgsl +++ b/crates/benilla-assets/src/shaders/fog_hook.wgsl @@ -99,7 +99,8 @@ fn fog_modern_survival(span: vec2, d: f32, world_y: f32, height_row: vec4, @@ -114,8 +115,8 @@ fn fog_sky_horizon( } let far = fog_modern_colour(horizon_rgb, dir, 1.0e9, sun_row, end_row, sel_row); let elev = asin(clamp(dir.y, -1.0, 1.0)); - let w = 1.0 - smoothstep(0.0, 0.20943951, elev); - return clamp(col + (far - horizon_rgb) * w, vec3(0.0), vec3(1.0)); + let w = 1.0 - smoothstep(0.0, 0.26179939, elev); + return mix(col, far, w); } // The fog a surface stands in: rgb = the fog colour, w = how much of the surface survives (1 = no diff --git a/crates/benilla-world/src/lighting/fog_model.rs b/crates/benilla-world/src/lighting/fog_model.rs index a700116f..22a0d21b 100644 --- a/crates/benilla-world/src/lighting/fog_model.rs +++ b/crates/benilla-world/src/lighting/fog_model.rs @@ -90,12 +90,12 @@ pub fn modern_fog_end(fog_end_raw: f32, fog_start_frac: f32, farclip: f32) -> (f } /// Sun-fog lobe defaults (no `LightFogBand` row): strength and the cosine the lobe starts at. -pub const DERIVED_SUN_FOG_STRENGTH: f32 = 0.5; -pub const DERIVED_SUN_FOG_ANGLE: f32 = 0.25; +pub const DERIVED_SUN_FOG_STRENGTH: f32 = 0.25; +pub const DERIVED_SUN_FOG_ANGLE: f32 = 0.4; /// How far the sun-fog colour leans from the fog colour toward the sun colour (IntBand 9). -const DERIVED_SUN_FOG_LEAN: f32 = 0.6; +const DERIVED_SUN_FOG_LEAN: f32 = 0.4; /// How far the end-fog colour leans from the fog colour toward the 1.8° sky ring. -const DERIVED_END_FOG_LEAN: f32 = 0.5; +const DERIVED_END_FOG_LEAN: f32 = 0.25; fn mix3(a: [f32; 3], b: [f32; 3], t: f32) -> [f32; 3] { [ diff --git a/crates/benilla-world/src/lighting/mod.rs b/crates/benilla-world/src/lighting/mod.rs index 9fe4d4bd..41ebdedd 100644 --- a/crates/benilla-world/src/lighting/mod.rs +++ b/crates/benilla-world/src/lighting/mod.rs @@ -407,6 +407,11 @@ mod ordering_tests { "the celestial follows: PostUpdate, BillboardPlace", ), ("weather/precip/mod.rs", "push_precip: PostUpdate"), + // MONKEY (fog) + ( + "lighting/fog_model.rs", + "update_fog_model: in the resolve set, .after(update_time_lighting)", + ), // MONKEY (daylight fixtures / portal bleed): both systems are PostUpdate, // chained before `global_light::classify_light_lanes`. (