MONKEY (fix-sky): order the sky and cloud FX readers after tick_clouds

Review B9: update_sky_colors and update_cloud_fx read the cloud coverage with no
order against tick_clouds, so the glow's cover sample was this frame's or the
last one's nondeterministically. New CloudTick set; both run after it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pkuzic
2026-09-25 17:02:09 +01:00
co-authored by Claude Opus 5.5
parent 4f5dd17f8d
commit 263d7ab765
2 changed files with 15 additions and 3 deletions
+11 -2
View File
@@ -63,14 +63,18 @@ impl Plugin for CloudsPlugin {
// air's density and palette rather than the water's.
tick_clouds
.after(crate::liquid::SubmersionVerdict)
.in_set(crate::lighting::LightingConsumeSet),
.in_set(crate::lighting::LightingConsumeSet)
.in_set(CloudTick),
// After the skybox resolve and the submersion verdict, so the dome hides in
// the same frame as the rest of the sky.
layer::apply_cloud_visibility
.after(crate::skybox::SkyboxResolve)
.after(crate::liquid::SubmersionVerdict),
// MONKEY (sky): the High cloud shading's per-frame inputs.
layer::update_cloud_fx.in_set(crate::lighting::LightingConsumeSet),
// MONKEY (fix-sky): after this frame's tile, deterministically.
layer::update_cloud_fx
.in_set(crate::lighting::LightingConsumeSet)
.after(CloudTick),
),
)
// Camera-anchored after transform propagation, like the sky dome.
@@ -83,6 +87,11 @@ impl Plugin for CloudsPlugin {
/// Advances the coverage field (a full rebuild first, then the 10 Hz band scroll) and re-uploads
/// its texels when they change, as the reference does per regen (`0x58ac70`).
/// MONKEY (fix-sky): the cloud tile/coverage update, so the sky and cloud FX readers can order
/// after it (review B9: the ambiguous order made the glow's cover sample frame-nondeterministic).
#[derive(SystemSet, Debug, Clone, PartialEq, Eq, Hash)]
pub(crate) struct CloudTick;
fn tick_clouds(
mut cov: ResMut<CloudCoverage>,
light: Res<WowLighting>,
+4 -1
View File
@@ -137,7 +137,10 @@ impl Plugin for SkyPlugin {
(
// Reads the resolved atmosphere: unordered, it would paint last frame's
// palette, the underwater one on a surfacing frame.
update_sky_colors.in_set(crate::lighting::LightingConsumeSet),
// MONKEY (fix-sky): after the cloud tile, so the glow reads this frame's cover.
update_sky_colors
.in_set(crate::lighting::LightingConsumeSet)
.after(crate::clouds::CloudTick),
// The skybox and submersion gates must read their settled resolves.
apply_sky_visibility
.after(crate::skybox::SkyboxResolve)