-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Fix MSAA writeback when 3 or more cameras have the same target. #11968
Merged
Conversation
This file contains 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
alice-i-cecile
added
C-Bug
An unexpected or incorrect behavior
A-Rendering
Drawing game state to the screen
labels
Feb 19, 2024
Fixes #12006 |
djeedai
added
the
P-Regression
Functionality that used to work but no longer does. Add a test for this!
label
Feb 20, 2024
djeedai
approved these changes
Feb 20, 2024
alice-i-cecile
approved these changes
Feb 20, 2024
alice-i-cecile
added
the
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
label
Feb 20, 2024
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 20, 2024
# Objective Improve `split_screen` example to use 4 cameras. This serves as a visual regression test for #12006. ## Solution With the fix of #11968: ![image](https://github.com/bevyengine/bevy/assets/6532395/57e9e013-7d23-429f-98ac-c6542d6b4bea) Without (current `main`): ![image](https://github.com/bevyengine/bevy/assets/6532395/0b2a88a4-97f8-408d-8a0e-ce917efc668d)
msvbg
pushed a commit
to msvbg/bevy
that referenced
this pull request
Feb 26, 2024
# Objective Improve `split_screen` example to use 4 cameras. This serves as a visual regression test for bevyengine#12006. ## Solution With the fix of bevyengine#11968: ![image](https://github.com/bevyengine/bevy/assets/6532395/57e9e013-7d23-429f-98ac-c6542d6b4bea) Without (current `main`): ![image](https://github.com/bevyengine/bevy/assets/6532395/0b2a88a4-97f8-408d-8a0e-ce917efc668d)
msvbg
pushed a commit
to msvbg/bevy
that referenced
this pull request
Feb 26, 2024
…engine#11968) # Objective If multiple cameras render to the same target with MSAA enabled, only the first and the last camera output will appear in the final output*. This is because each camera maintains a separate flag to track the active main texture. The first camera renders to texture A and all subsequent cameras first write-back from A and then render into texture B. Hence, camera 3 onwards will overwrite the work of the previous camera. \* This would manifest slightly differently if there were other calls to post_process_write() in a more complex setup. The is a functional regression from Bevy 0.12. ## Solution The flag which tracks the active main texture should be shared between cameras with the same `NormalizedRenderTarget`. Add the `Arc<AtomicUsize>` to the existing per-target cache.
msvbg
pushed a commit
to msvbg/bevy
that referenced
this pull request
Feb 26, 2024
# Objective Improve `split_screen` example to use 4 cameras. This serves as a visual regression test for bevyengine#12006. ## Solution With the fix of bevyengine#11968: ![image](https://github.com/bevyengine/bevy/assets/6532395/57e9e013-7d23-429f-98ac-c6542d6b4bea) Without (current `main`): ![image](https://github.com/bevyengine/bevy/assets/6532395/0b2a88a4-97f8-408d-8a0e-ce917efc668d)
msvbg
pushed a commit
to msvbg/bevy
that referenced
this pull request
Feb 26, 2024
…engine#11968) # Objective If multiple cameras render to the same target with MSAA enabled, only the first and the last camera output will appear in the final output*. This is because each camera maintains a separate flag to track the active main texture. The first camera renders to texture A and all subsequent cameras first write-back from A and then render into texture B. Hence, camera 3 onwards will overwrite the work of the previous camera. \* This would manifest slightly differently if there were other calls to post_process_write() in a more complex setup. The is a functional regression from Bevy 0.12. ## Solution The flag which tracks the active main texture should be shared between cameras with the same `NormalizedRenderTarget`. Add the `Arc<AtomicUsize>` to the existing per-target cache.
mockersf
pushed a commit
that referenced
this pull request
Feb 27, 2024
# Objective If multiple cameras render to the same target with MSAA enabled, only the first and the last camera output will appear in the final output*. This is because each camera maintains a separate flag to track the active main texture. The first camera renders to texture A and all subsequent cameras first write-back from A and then render into texture B. Hence, camera 3 onwards will overwrite the work of the previous camera. \* This would manifest slightly differently if there were other calls to post_process_write() in a more complex setup. The is a functional regression from Bevy 0.12. ## Solution The flag which tracks the active main texture should be shared between cameras with the same `NormalizedRenderTarget`. Add the `Arc<AtomicUsize>` to the existing per-target cache.
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
P-Regression
Functionality that used to work but no longer does. Add a test for this!
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
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.
Objective
If multiple cameras render to the same target with MSAA enabled, only the first and the last camera output will appear in the final output*. This is because each camera maintains a separate flag to track the active main texture. The first camera renders to texture A and all subsequent cameras first write-back from A and then render into texture B. Hence, camera 3 onwards will overwrite the work of the previous camera.
* This would manifest slightly differently if there were other calls to post_process_write() in a more complex setup.
The is a functional regression from Bevy 0.12.
Solution
The flag which tracks the active main texture should be shared between cameras with the same
NormalizedRenderTarget
. Add theArc<AtomicUsize>
to the existing per-target cache.