Fix rounding bug in camera projection#16828
Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom Dec 15, 2024
Merged
Conversation
Contributor
|
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
mockersf
approved these changes
Dec 15, 2024
alice-i-cecile
approved these changes
Dec 15, 2024
Member
alice-i-cecile
left a comment
There was a problem hiding this comment.
Thank you both for spotting this. I was the one to introduce this regression!
ecoskey
pushed a commit
to ecoskey/bevy
that referenced
this pull request
Jan 6, 2025
# Objective Fixes bevyengine#16773 ## Solution bevyengine#15969 introduces a regression that causes image tearing when `ImageFilterMode::Nearest` is used as the sampler. Rounding the origin fixes the issue. Credits to @sophrosyne97 for bisecting and finding the commit that broke it. ## Testing You can test it with this repository: https://github.com/musjj/nearest_filter_bug ```bash git clone https://github.com/musjj/nearest_filter_bug cd nearest_filter_bug echo '[patch.crates-io]\nbevy = { git = "https://github.com/musjj/bevy.git", branch = "rounding-bug" }' >>Cargo.toml sed -i -e 's/0.15.0/0.15.0-dev/' Cargo.toml cargo update && cargo run ``` Gradually resize the window to various sizes, while paying attention to the sprite and font. No tearing should occur on any window resolution, even on odd numbers. Tested on Linux with Gnome. Tests on other platforms would be appreciated. --- ## Showcase Before:  After: 
hukasu
added a commit
to hukasu/bevy
that referenced
this pull request
Jan 28, 2025
This reverts commit ae52222.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 2, 2025
This reverts commit ae52222. # Objective Fixes #16856 ## Solution Remove rounding from `OrthographicProjection::update`, which was causing the center of the orthographic projection to be off center. ## Testing Ran the examples mentioned on #16856 and code from #16773 ## Showcase `orthographic` example  `projection_zoom` example  `camera_sub_view` example  `custom_primitives` example  #16773 code 
mrchantey
pushed a commit
to mrchantey/bevy
that referenced
this pull request
Feb 4, 2025
# Objective Fixes bevyengine#16773 ## Solution bevyengine#15969 introduces a regression that causes image tearing when `ImageFilterMode::Nearest` is used as the sampler. Rounding the origin fixes the issue. Credits to @sophrosyne97 for bisecting and finding the commit that broke it. ## Testing You can test it with this repository: https://github.com/musjj/nearest_filter_bug ```bash git clone https://github.com/musjj/nearest_filter_bug cd nearest_filter_bug echo '[patch.crates-io]\nbevy = { git = "https://github.com/musjj/bevy.git", branch = "rounding-bug" }' >>Cargo.toml sed -i -e 's/0.15.0/0.15.0-dev/' Cargo.toml cargo update && cargo run ``` Gradually resize the window to various sizes, while paying attention to the sprite and font. No tearing should occur on any window resolution, even on odd numbers. Tested on Linux with Gnome. Tests on other platforms would be appreciated. --- ## Showcase Before:  After: 
mrchantey
pushed a commit
to mrchantey/bevy
that referenced
this pull request
Feb 4, 2025
…vyengine#17592) This reverts commit ae52222. # Objective Fixes bevyengine#16856 ## Solution Remove rounding from `OrthographicProjection::update`, which was causing the center of the orthographic projection to be off center. ## Testing Ran the examples mentioned on bevyengine#16856 and code from bevyengine#16773 ## Showcase `orthographic` example  `projection_zoom` example  `camera_sub_view` example  `custom_primitives` example  bevyengine#16773 code 
holmes-software
pushed a commit
to holmes-software/bevy
that referenced
this pull request
Feb 5, 2025
…vyengine#17592) This reverts commit ae52222. # Objective Fixes bevyengine#16856 ## Solution Remove rounding from `OrthographicProjection::update`, which was causing the center of the orthographic projection to be off center. ## Testing Ran the examples mentioned on bevyengine#16856 and code from bevyengine#16773 ## Showcase `orthographic` example  `projection_zoom` example  `camera_sub_view` example  `custom_primitives` example  bevyengine#16773 code 
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Fixes #16773
Solution
#15969 introduces a regression that causes image tearing when
ImageFilterMode::Nearestis used as the sampler. Rounding the origin fixes the issue.Credits to @sophrosyne97 for bisecting and finding the commit that broke it.
Testing
You can test it with this repository: https://github.com/musjj/nearest_filter_bug
Gradually resize the window to various sizes, while paying attention to the sprite and font. No tearing should occur on any window resolution, even on odd numbers.
Tested on Linux with Gnome. Tests on other platforms would be appreciated.
Showcase
Before:
After: