Add explicit ordering between update_frusta and camera_system (#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
This commit is contained in:
parent
675607a7e6
commit
5e2d9b4ae4
@ -14,7 +14,10 @@ use std::cell::Cell;
|
|||||||
use thread_local::ThreadLocal;
|
use thread_local::ThreadLocal;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
camera::{Camera, CameraProjection, OrthographicProjection, PerspectiveProjection, Projection},
|
camera::{
|
||||||
|
camera_system, Camera, CameraProjection, OrthographicProjection, PerspectiveProjection,
|
||||||
|
Projection,
|
||||||
|
},
|
||||||
mesh::Mesh,
|
mesh::Mesh,
|
||||||
primitives::{Aabb, Frustum, Sphere},
|
primitives::{Aabb, Frustum, Sphere},
|
||||||
};
|
};
|
||||||
@ -186,18 +189,21 @@ impl Plugin for VisibilityPlugin {
|
|||||||
CoreStage::PostUpdate,
|
CoreStage::PostUpdate,
|
||||||
update_frusta::<OrthographicProjection>
|
update_frusta::<OrthographicProjection>
|
||||||
.label(UpdateOrthographicFrusta)
|
.label(UpdateOrthographicFrusta)
|
||||||
|
.after(camera_system::<OrthographicProjection>)
|
||||||
.after(TransformSystem::TransformPropagate),
|
.after(TransformSystem::TransformPropagate),
|
||||||
)
|
)
|
||||||
.add_system_to_stage(
|
.add_system_to_stage(
|
||||||
CoreStage::PostUpdate,
|
CoreStage::PostUpdate,
|
||||||
update_frusta::<PerspectiveProjection>
|
update_frusta::<PerspectiveProjection>
|
||||||
.label(UpdatePerspectiveFrusta)
|
.label(UpdatePerspectiveFrusta)
|
||||||
|
.after(camera_system::<PerspectiveProjection>)
|
||||||
.after(TransformSystem::TransformPropagate),
|
.after(TransformSystem::TransformPropagate),
|
||||||
)
|
)
|
||||||
.add_system_to_stage(
|
.add_system_to_stage(
|
||||||
CoreStage::PostUpdate,
|
CoreStage::PostUpdate,
|
||||||
update_frusta::<Projection>
|
update_frusta::<Projection>
|
||||||
.label(UpdateProjectionFrusta)
|
.label(UpdateProjectionFrusta)
|
||||||
|
.after(camera_system::<Projection>)
|
||||||
.after(TransformSystem::TransformPropagate),
|
.after(TransformSystem::TransformPropagate),
|
||||||
)
|
)
|
||||||
.add_system_to_stage(
|
.add_system_to_stage(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user