Run CheckVisibility
after all the other visibility system sets have… (#12962)
# Objective Make visibility system ordering explicit. Fixes #12953. ## Solution Specify `CheckVisibility` happens after all other `VisibilitySystems` sets have happened. --------- Co-authored-by: Elabajaba <Elabajaba@users.noreply.github.com>
This commit is contained in:
parent
2b3e3341d6
commit
f68bc01544
@ -350,14 +350,7 @@ impl Plugin for PbrPlugin {
|
|||||||
.in_set(SimulationLightSystems::UpdateLightFrusta)
|
.in_set(SimulationLightSystems::UpdateLightFrusta)
|
||||||
.after(TransformSystem::TransformPropagate)
|
.after(TransformSystem::TransformPropagate)
|
||||||
.after(SimulationLightSystems::AssignLightsToClusters),
|
.after(SimulationLightSystems::AssignLightsToClusters),
|
||||||
check_visibility::<WithLight>
|
check_visibility::<WithLight>.in_set(VisibilitySystems::CheckVisibility),
|
||||||
.in_set(VisibilitySystems::CheckVisibility)
|
|
||||||
.after(VisibilitySystems::CalculateBounds)
|
|
||||||
.after(VisibilitySystems::UpdateOrthographicFrusta)
|
|
||||||
.after(VisibilitySystems::UpdatePerspectiveFrusta)
|
|
||||||
.after(VisibilitySystems::UpdateProjectionFrusta)
|
|
||||||
.after(VisibilitySystems::VisibilityPropagate)
|
|
||||||
.after(TransformSystem::TransformPropagate),
|
|
||||||
check_light_mesh_visibility
|
check_light_mesh_visibility
|
||||||
.in_set(SimulationLightSystems::CheckLightVisibility)
|
.in_set(SimulationLightSystems::CheckLightVisibility)
|
||||||
.after(VisibilitySystems::CalculateBounds)
|
.after(VisibilitySystems::CalculateBounds)
|
||||||
|
@ -83,7 +83,6 @@ use bevy_render::{
|
|||||||
ExtractSchedule, Render, RenderApp, RenderSet,
|
ExtractSchedule, Render, RenderApp, RenderSet,
|
||||||
};
|
};
|
||||||
use bevy_transform::components::{GlobalTransform, Transform};
|
use bevy_transform::components::{GlobalTransform, Transform};
|
||||||
use bevy_transform::TransformSystem;
|
|
||||||
|
|
||||||
const MESHLET_BINDINGS_SHADER_HANDLE: Handle<Shader> = Handle::weak_from_u128(1325134235233421);
|
const MESHLET_BINDINGS_SHADER_HANDLE: Handle<Shader> = Handle::weak_from_u128(1325134235233421);
|
||||||
const MESHLET_MESH_MATERIAL_SHADER_HANDLE: Handle<Shader> =
|
const MESHLET_MESH_MATERIAL_SHADER_HANDLE: Handle<Shader> =
|
||||||
@ -168,14 +167,7 @@ impl Plugin for MeshletPlugin {
|
|||||||
.insert_resource(Msaa::Off)
|
.insert_resource(Msaa::Off)
|
||||||
.add_systems(
|
.add_systems(
|
||||||
PostUpdate,
|
PostUpdate,
|
||||||
check_visibility::<WithMeshletMesh>
|
check_visibility::<WithMeshletMesh>.in_set(VisibilitySystems::CheckVisibility),
|
||||||
.in_set(VisibilitySystems::CheckVisibility)
|
|
||||||
.after(VisibilitySystems::CalculateBounds)
|
|
||||||
.after(VisibilitySystems::UpdateOrthographicFrusta)
|
|
||||||
.after(VisibilitySystems::UpdatePerspectiveFrusta)
|
|
||||||
.after(VisibilitySystems::UpdateProjectionFrusta)
|
|
||||||
.after(VisibilitySystems::VisibilityPropagate)
|
|
||||||
.after(TransformSystem::TransformPropagate),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,14 +259,25 @@ impl Plugin for VisibilityPlugin {
|
|||||||
fn build(&self, app: &mut bevy_app::App) {
|
fn build(&self, app: &mut bevy_app::App) {
|
||||||
use VisibilitySystems::*;
|
use VisibilitySystems::*;
|
||||||
|
|
||||||
app.add_systems(
|
app.configure_sets(
|
||||||
|
PostUpdate,
|
||||||
|
(
|
||||||
|
CalculateBounds,
|
||||||
|
UpdateOrthographicFrusta,
|
||||||
|
UpdatePerspectiveFrusta,
|
||||||
|
UpdateProjectionFrusta,
|
||||||
|
VisibilityPropagate,
|
||||||
|
)
|
||||||
|
.before(CheckVisibility)
|
||||||
|
.after(TransformSystem::TransformPropagate),
|
||||||
|
)
|
||||||
|
.add_systems(
|
||||||
PostUpdate,
|
PostUpdate,
|
||||||
(
|
(
|
||||||
calculate_bounds.in_set(CalculateBounds),
|
calculate_bounds.in_set(CalculateBounds),
|
||||||
update_frusta::<OrthographicProjection>
|
update_frusta::<OrthographicProjection>
|
||||||
.in_set(UpdateOrthographicFrusta)
|
.in_set(UpdateOrthographicFrusta)
|
||||||
.after(camera_system::<OrthographicProjection>)
|
.after(camera_system::<OrthographicProjection>)
|
||||||
.after(TransformSystem::TransformPropagate)
|
|
||||||
// We assume that no camera will have more than one projection component,
|
// We assume that no camera will have more than one projection component,
|
||||||
// so these systems will run independently of one another.
|
// so these systems will run independently of one another.
|
||||||
// FIXME: Add an archetype invariant for this https://github.com/bevyengine/bevy/issues/1481.
|
// FIXME: Add an archetype invariant for this https://github.com/bevyengine/bevy/issues/1481.
|
||||||
@ -275,24 +286,15 @@ impl Plugin for VisibilityPlugin {
|
|||||||
update_frusta::<PerspectiveProjection>
|
update_frusta::<PerspectiveProjection>
|
||||||
.in_set(UpdatePerspectiveFrusta)
|
.in_set(UpdatePerspectiveFrusta)
|
||||||
.after(camera_system::<PerspectiveProjection>)
|
.after(camera_system::<PerspectiveProjection>)
|
||||||
.after(TransformSystem::TransformPropagate)
|
|
||||||
// We assume that no camera will have more than one projection component,
|
// We assume that no camera will have more than one projection component,
|
||||||
// so these systems will run independently of one another.
|
// so these systems will run independently of one another.
|
||||||
// FIXME: Add an archetype invariant for this https://github.com/bevyengine/bevy/issues/1481.
|
// FIXME: Add an archetype invariant for this https://github.com/bevyengine/bevy/issues/1481.
|
||||||
.ambiguous_with(update_frusta::<Projection>),
|
.ambiguous_with(update_frusta::<Projection>),
|
||||||
update_frusta::<Projection>
|
update_frusta::<Projection>
|
||||||
.in_set(UpdateProjectionFrusta)
|
.in_set(UpdateProjectionFrusta)
|
||||||
.after(camera_system::<Projection>)
|
.after(camera_system::<Projection>),
|
||||||
.after(TransformSystem::TransformPropagate),
|
|
||||||
(visibility_propagate_system, reset_view_visibility).in_set(VisibilityPropagate),
|
(visibility_propagate_system, reset_view_visibility).in_set(VisibilityPropagate),
|
||||||
check_visibility::<WithMesh>
|
check_visibility::<WithMesh>.in_set(CheckVisibility),
|
||||||
.in_set(CheckVisibility)
|
|
||||||
.after(CalculateBounds)
|
|
||||||
.after(UpdateOrthographicFrusta)
|
|
||||||
.after(UpdatePerspectiveFrusta)
|
|
||||||
.after(UpdateProjectionFrusta)
|
|
||||||
.after(VisibilityPropagate)
|
|
||||||
.after(TransformSystem::TransformPropagate),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,6 @@ pub mod prelude {
|
|||||||
}
|
}
|
||||||
|
|
||||||
use bevy_reflect::{std_traits::ReflectDefault, Reflect};
|
use bevy_reflect::{std_traits::ReflectDefault, Reflect};
|
||||||
use bevy_transform::TransformSystem;
|
|
||||||
pub use bundle::*;
|
pub use bundle::*;
|
||||||
pub use dynamic_texture_atlas_builder::*;
|
pub use dynamic_texture_atlas_builder::*;
|
||||||
pub use mesh2d::*;
|
pub use mesh2d::*;
|
||||||
@ -122,13 +121,7 @@ impl Plugin for SpritePlugin {
|
|||||||
check_visibility::<WithMesh2d>,
|
check_visibility::<WithMesh2d>,
|
||||||
check_visibility::<WithSprite>,
|
check_visibility::<WithSprite>,
|
||||||
)
|
)
|
||||||
.in_set(VisibilitySystems::CheckVisibility)
|
.in_set(VisibilitySystems::CheckVisibility),
|
||||||
.after(VisibilitySystems::CalculateBounds)
|
|
||||||
.after(VisibilitySystems::UpdateOrthographicFrusta)
|
|
||||||
.after(VisibilitySystems::UpdatePerspectiveFrusta)
|
|
||||||
.after(VisibilitySystems::UpdateProjectionFrusta)
|
|
||||||
.after(VisibilitySystems::VisibilityPropagate)
|
|
||||||
.after(TransformSystem::TransformPropagate),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -137,13 +137,7 @@ impl Plugin for UiPlugin {
|
|||||||
app.add_systems(
|
app.add_systems(
|
||||||
PostUpdate,
|
PostUpdate,
|
||||||
(
|
(
|
||||||
check_visibility::<WithNode>
|
check_visibility::<WithNode>.in_set(VisibilitySystems::CheckVisibility),
|
||||||
.in_set(VisibilitySystems::CheckVisibility)
|
|
||||||
.after(VisibilitySystems::CalculateBounds)
|
|
||||||
.after(VisibilitySystems::UpdateOrthographicFrusta)
|
|
||||||
.after(VisibilitySystems::UpdatePerspectiveFrusta)
|
|
||||||
.after(VisibilitySystems::UpdateProjectionFrusta)
|
|
||||||
.after(VisibilitySystems::VisibilityPropagate),
|
|
||||||
update_target_camera_system.before(UiSystem::Layout),
|
update_target_camera_system.before(UiSystem::Layout),
|
||||||
apply_deferred
|
apply_deferred
|
||||||
.after(update_target_camera_system)
|
.after(update_target_camera_system)
|
||||||
|
Loading…
Reference in New Issue
Block a user