From b1fd9eddbb6db8cc886bfdaee8dc18a1d35ed362 Mon Sep 17 00:00:00 2001 From: IceSentry Date: Tue, 14 Nov 2023 17:35:40 -0500 Subject: [PATCH] Fix post processing example to only run effect on camera with settings component (#10560) # Objective - The example says it will only run on a camera with the `PostProcessingSettings` component but the node never filters it. ## Solution - Add the component to the `ViewQuery` closes: https://github.com/bevyengine/bevy/issues/10541 --- examples/shader/post_processing.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/shader/post_processing.rs b/examples/shader/post_processing.rs index 66d26cffbc..39a6c46530 100644 --- a/examples/shader/post_processing.rs +++ b/examples/shader/post_processing.rs @@ -123,7 +123,11 @@ impl ViewNode for PostProcessNode { // but it's not a normal system so we need to define it manually. // // This query will only run on the view entity - type ViewQuery = &'static ViewTarget; + type ViewQuery = ( + &'static ViewTarget, + // This makes sure the node only runs on cameras with the PostProcessSettings component + &'static PostProcessSettings, + ); // Runs the node logic // This is where you encode draw commands. @@ -136,7 +140,7 @@ impl ViewNode for PostProcessNode { &self, _graph: &mut RenderGraphContext, render_context: &mut RenderContext, - view_target: QueryItem, + (view_target, _post_process_settings): QueryItem, world: &World, ) -> Result<(), NodeRunError> { // Get the pipeline resource that contains the global data we need