-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix deactivated camera still being used in render world #15946
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
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
In my opinion this is going to be extremely difficult to maintain. The moment that a new component that should be listed here for removal is added, it almost for sure won't.
Is this the only solution? Is there some equivalent of "required components" that automatically removes other components, if one is removed?
Another question (just to understand): what happens when a camera that is made inactive is re-activated? Is there already a solution to re-add these components automatically on reactivation?
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.
Yes, this is not ideal. However, since insertion and removal are handled within this single function, it's not unmanageable for now, I guess. We need better solution, but it might be too late for 0.15 unfortunately.
Unless we hit this branch and
continue
,commands.insert
below inserts these components every frame (redundantly)."Re-insert every frame" was seemingly intended to be a temporary but working solution until we get to redesign extraction to benefit more from retained render world (per Next Steps in original PR), but unfortunately issues like this were found lately that already require removing components. So hopefully this is all temporary.
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.
Do we actually need to remove all of those components?
Wouldn't removing
ExtractedView
be enough to halt all processing for this camera?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.
@MiniaczQ Removing
ExtractedView
alone wouldn't fix all the problems. In this PR I was focusing onrender_primitives
example and I started from from trying to fix warnings about camera ambiguity fromsort_cameras
system. This system uses onlyExtractedCamera
component so it would still spam the logs.Could less components be removed? Probably. That's what I initially implemented although I don't know if the set I proposed was minimal (it was pretty much arbitrary on my side).
For me it makes sense to remove all components that the system inserts and it's easier to reason about than look through all the systems and check which components are important and should be removed and which could be left.
But I agree it's not perfect and could be hard to synchronize. I hope that in the future a better more ergonomic and hopefully generic solution will be found. But for 0.15 I think it is good enough.
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.
Oof. Agree with all the comments here, but hope this is at least good motivation to take a look at how this should work at the beginning of 0.16.