diff --git a/crates/victory-gpu/src/ambient.rs b/crates/victory-gpu/src/ambient.rs index edf4fdd..836c2e2 100644 --- a/crates/victory-gpu/src/ambient.rs +++ b/crates/victory-gpu/src/ambient.rs @@ -655,7 +655,7 @@ pub(crate) fn note_miss(note: MissNote) { tracing::info!( "a stand-in for reflections (VICTORY_AMBIENT_SPECULAR={share},{sky}) in the last {:.0} s: \ {} frames, {} dispatches of CS_RayMiss followed (surfaces: {}), each by an estimate along \ - the reflected direction put in right after it (before CS_ResolveScreenSpace); {} of water \ + the reflected direction put in right after it (before CS_ResolveScreenSpace); {} of water or the alpha layer \ and {} before a frame's light was kept left as the title had them", now.duration_since(since).as_secs_f32(), s.frames.swap(0, Relaxed), diff --git a/crates/victory-gpu/src/draw.rs b/crates/victory-gpu/src/draw.rs index 7a1bfea..c09e693 100644 --- a/crates/victory-gpu/src/draw.rs +++ b/crates/victory-gpu/src/draw.rs @@ -3786,7 +3786,15 @@ impl State { .unwrap_or(u32::MAX), _ => 0, }; - if role == Role::Miss && !matches!(layer, crate::ambient::MISS_OPAQUE | crate::ambient::MISS_ALPHA) { + // The alpha layer only with VICTORY_AMBIENT_SPECULAR_ALPHA=1: its pixels + // are of transparent surfaces (glass, foam, wakes on water) and the + // depth read is the opaque one behind them; outdoors on water that is + // the bottom, the reflected direction is wrong and the estimate dark + // (play session 2026-11-27: dark patches on the water around a boat). + let alpha_too = std::env::var("VICTORY_AMBIENT_SPECULAR_ALPHA").is_ok_and(|v| v.trim() == "1"); + if role == Role::Miss + && !(layer == crate::ambient::MISS_OPAQUE || (alpha_too && layer == crate::ambient::MISS_ALPHA)) + { crate::ambient::note_miss(MissNote::Water); return false; }