Skip to content

Commit

Permalink
Run update_previous_view_projections in PreUpdate schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
geieredgar committed Jul 2, 2023
1 parent 94291cf commit 683b2e0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/bevy_pbr/src/prepass/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,15 @@ where

if no_prepass_plugin_loaded {
app.insert_resource(AnyPrepassPluginLoaded)
.add_systems(Update, update_previous_view_projections)
// At the start of each frame, last frame's GlobalTransforms become this frame's PreviousGlobalTransforms
.add_systems(PreUpdate, update_mesh_previous_global_transforms);
// and last frame's view projection matrices become this frame's PreviousViewProjections
.add_systems(
PreUpdate,
(
update_mesh_previous_global_transforms,
update_previous_view_projections,
),
);
}

let Ok(render_app) = app.get_sub_app_mut(RenderApp) else {
Expand Down

0 comments on commit 683b2e0

Please sign in to comment.