-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Use RenderStartup
for SSAO systems.
#20206
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
base: main
Are you sure you want to change the base?
Conversation
ebd1078
to
80ad27c
Compare
80ad27c
to
c8ebfa8
Compare
c8ebfa8
to
3a91f1a
Compare
I just noticed that there's quite a bad limitation to the |
I added a little hack for this. If you want to order the condition, you can configure |
f552ac1
to
849bb1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense to me, i think the conditional is still nice
849bb1a
to
7c5e973
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. This uses run conditions (not 100% ideal, conditionally adding systems / removing them would be slightly lower overhead), and there's gnarly "configure this system set across multiple schedules" nonsense, which is something that shouldn't be necessary.
That said, there's a lot to be said for having a consistent way to do this, and the exact details are clear and well documented.
Let me think about better patterns, to see if we can get something better now without waiting on further improvements to scheduling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've thought harder about this, and I really don't like the complexity and ad-hoc nature of conditional_render_set
. If we had commands.add_systems
, would that work fine for you? That's one straightforward PR away. It's already possible by mutating Schedules
, but a command would make it a bit clearer and less boilerplate.
The core request here is "conditionally add systems" and with the RenderStartup
changes, we need to move this from plugin-init time to normal systems.
@alice-i-cecile I have a couple concerns with that. First, it means we can't conditionally have systems in RenderStartup, because of course we can't add systems to the schedule we are currently in. That can be worked around by either making a mega system to build all the resources in one system (though some of these systems get pretty big already with a single resource), or you can check whether the feature is supported in the system. Second, these systems won't show up on tools like bevy_mod_debugdump. It's a little concerning to me to have first-party "sneaky systems". Perhaps in the future, we'll have tools to debug schedules after launch, but that's probably not gonna be the first iteration anyway even for the bevy editor. These are problems we could live with, but I wasn't excited about these caveats |
Okay, hmm. I see your point there with the drawbacks of conditionally adding systems. If we're not going to conditionally add systems, a run condition is about as good as it can get. This is well-encapsulated, so I can swallow it for now. Let me get feedback from the Rendering SMEs before taking on this tech debt though. |
Objective
RenderStartup
.Solution
RenderStartup
.conditional_render_set
to generalize the pattern of creating system sets + resources to conditionally run systems!Thanks to @JMS55 for suggesting this generalization in #19918!
Testing