Skip to content

Commit d876c5e

Browse files
TheRawMeatballjames7132
authored andcommitted
Add explicit ordering between update_frusta and camera_system (bevyengine#5757)
# Objective Fix a nasty system ordering bug between `update_frusta` and `camera_system` that lead to incorrect frustum s, leading to excessive culling and extremely hard-to-debug visual glitches ## Solution - add explicit system ordering
1 parent d6dc7f6 commit d876c5e

File tree

1 file changed

+7
-1
lines changed
  • crates/bevy_render/src/view/visibility

1 file changed

+7
-1
lines changed

crates/bevy_render/src/view/visibility/mod.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ use std::cell::Cell;
1414
use thread_local::ThreadLocal;
1515

1616
use crate::{
17-
camera::{Camera, CameraProjection, OrthographicProjection, PerspectiveProjection, Projection},
17+
camera::{
18+
camera_system, Camera, CameraProjection, OrthographicProjection, PerspectiveProjection,
19+
Projection,
20+
},
1821
mesh::Mesh,
1922
primitives::{Aabb, Frustum, Sphere},
2023
};
@@ -186,18 +189,21 @@ impl Plugin for VisibilityPlugin {
186189
CoreStage::PostUpdate,
187190
update_frusta::<OrthographicProjection>
188191
.label(UpdateOrthographicFrusta)
192+
.after(camera_system::<OrthographicProjection>)
189193
.after(TransformSystem::TransformPropagate),
190194
)
191195
.add_system_to_stage(
192196
CoreStage::PostUpdate,
193197
update_frusta::<PerspectiveProjection>
194198
.label(UpdatePerspectiveFrusta)
199+
.after(camera_system::<PerspectiveProjection>)
195200
.after(TransformSystem::TransformPropagate),
196201
)
197202
.add_system_to_stage(
198203
CoreStage::PostUpdate,
199204
update_frusta::<Projection>
200205
.label(UpdateProjectionFrusta)
206+
.after(camera_system::<Projection>)
201207
.after(TransformSystem::TransformPropagate),
202208
)
203209
.add_system_to_stage(

0 commit comments

Comments
 (0)