Skip to content

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