Skip to content

Use RenderStartup for screen space reflections. #20194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2025

Conversation

andriyDev
Copy link
Contributor

Objective

Solution

  • Convert FromWorld impls to systems in RenderStartup.
  • Add a system to conditionally add render graph edges (if a particular node exists).

Testing

  • Ran the ssr example and it still works.

@andriyDev andriyDev added A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 19, 2025
@andriyDev andriyDev requested review from IceSentry and atlv24 July 19, 2025 05:51
.add_systems(Render, prepare_ssr_pipelines.in_set(RenderSystems::Prepare))
.add_systems(
Render,
prepare_ssr_settings.in_set(RenderSystems::PrepareResources),
)
// Note: we add this node here but then we add edges in
// `add_screen_space_reflections_render_graph_edges`.
.add_render_graph_node::<ViewNodeRunner<ScreenSpaceReflectionsNode>>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason why you didn't move this? Is it just to keep behaviour as close as possible? Oh, could it break something later if the node isn't added in build?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly to try to keep the diff small, and also because initializing ViewNodeRunner requires &mut World, so I was hoping to avoid requiring &mut World in the system.

In fact I was considering going the other way and instead moving the one required graph edge here, and then only do the conditional edge in the system. But alas I decided to try to keep the edges together at least.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, keeping the diff small is fine by me. We'll likely want to do a cleanup pass after 0.18 but it's probably good to keep everything as close as what it was before for now.

@andriyDev andriyDev added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 20, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jul 21, 2025
Merged via the queue into bevyengine:main with commit f330efc Jul 21, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants