-
Notifications
You must be signed in to change notification settings - Fork 7.1k
images with preFX jitter #6879
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
Comments
For internal use onlyTo resolve the jitter issue with images using preFX when Implementation Steps:
// Before
this.matrix.applyITRS(Math.round(this.scrollX), Math.round(this.scrollY), this.rotation, this.zoomX, this.zoomY);
// After
this.matrix.applyITRS(Math.floor(this.scrollX), Math.floor(this.scrollY), this.rotation, this.zoomX, this.zoomY); This ensures that the rounding behavior is consistent, reducing the jitter effect for images with preFX. References/src/fx/Pixelate.js
|
Thank you for submitting this issue. We have fixed this and the fix has been pushed to the |
This improved it a lot, but there's still 1 pixel offset happening, seems like it depends on relative position to camera. E.g. camera scroll (midpoint or something) being above vs below the objects will shift them 1 px in y axis. |
Tested on latest master branch build and can confirm it's working |
Demo: https://phaser.io/sandbox/oWd6hjDQ
See the every second white square. The discriminating factor seems to be camera having
roundPixels: false
, it does happen regardless of camera zoom orpixelArt
mode. Happens on any Phaser version since preFX was added.My best guess is that some rounding happens in a different place across the rendering pipeline for images with preFX, than it does for standard ones, which results in them getting out of sync as camera scrolls around.
The text was updated successfully, but these errors were encountered: