diff --git a/content/news/2023-07-07-bevy-0.11/index.md b/content/news/2023-07-07-bevy-0.11/index.md index 3d0bc99389..6516dcd999 100644 --- a/content/news/2023-07-07-bevy-0.11/index.md +++ b/content/news/2023-07-07-bevy-0.11/index.md @@ -23,6 +23,57 @@ Since our last release a few months ago we've added a _ton_ of new features, bug Description +## Simpler RenderGraph Construction + +
+ +Adding `Node`s to the `RenderGraph` requires a lot of boilerplate. In this release, we tried to reduce this for most common operations. No existing APIs have been removed, these are only helpers made to simplify working with the `RenderGraph`. + +We added the `RenderGraphApp` trait to the `App`. This trait contains various helper functions to reduce the boilerplate with adding nodes and edges to a graph. + +Another pain point of `RenderGraph` `Node`s is passing the view entity through each node and manually updating the query on that view. To fix this we added a `ViewNode` trait and `ViewNodeRunner` that will automatically take care of running the `Query` on the view entity. We also made the view entity a first-class concept of the `RenderGraph`. So you can now access the view entity the graph is currently running on from anywhere in the graph without passing it around between each `Node`. + +All these new APIs assume that your Node implements `FromWorld` or `Default`. + +Here's what it looks like in practice for the `BloomNode`: + +```rust +// Adding the node to the 3d graph +render_app + // To run a ViewNode you need to create a ViewNodeRunner + .add_render_graph_node::