Skip to content
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

Break out Visible component from Draw #1034

Merged
merged 3 commits into from
Dec 9, 2020
Merged

Conversation

cart
Copy link
Member

@cart cart commented Dec 9, 2020

Alternative to #1008

The issue is that we currently incrementally update gpu bind resources when a given type T changes, but we filter the Changed results based on draw.is_visible. If something is initially invisible, it will show up in RenderResourcesNode's Changed<T> query then get filterered out because draw.is_visible is false.

The fix is to also update bindings when visibility changes. We can't use Changed<Draw>, because it changes every frame (when draw commands are queued). Therefore, it makes sense to break out the Visibility fields so we can respond to their changes separately.

This also just feels cleaner because draw commands and "visibility state" are tangentially related concepts at best.

@cart cart added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels Dec 9, 2020
Copy link
Contributor

@ambeeeeee ambeeeeee left a comment

Choose a reason for hiding this comment

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

I like this

@cart cart merged commit 7ab0eee into bevyengine:master Dec 9, 2020
@fopsdev fopsdev mentioned this pull request Jan 24, 2021
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-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants