Skip to content
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

Pixel Snap jitters with CanvasItems moving at different speeds #94005

Open
markdibarry opened this issue Jul 6, 2024 · 0 comments
Open

Pixel Snap jitters with CanvasItems moving at different speeds #94005

markdibarry opened this issue Jul 6, 2024 · 0 comments

Comments

@markdibarry
Copy link
Contributor

Tested versions

  • Reproducible since pixel snap was added

System information

Godot v4.3.beta (2729fc4) - Linux Mint 21.3 (Virginia) - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (nvidia; 535.183.01) - 13th Gen Intel(R) Core(TM) i5-13600KF (20 Threads)

Issue description

Since pixel snap was added, it has worked by snapping canvas items to whole numbers when rendering, whether that's by ceil, floor, round or another method. A persistent issue arises when you have things in motion at a different speed than the camera. This includes moving platforms, parallax backgrounds, or moving actors on screen. If another canvas item is moving at a different speed in the same or opposite direction from the camera's movement, the difference in whole number positions will jump back and forth between values, making the items appear to jitter on screen.

Below is an example using parallax:

2024-07-06.14-13-03.mp4

This has been a known issue for a long time, and is the expected behavior, but certainly not the desired behavior. A maintainable solution hasn't been proposed yet, but I thought it'd be worth it to make a formal issue, so users know we're aware.

Steps to reproduce

Have a resolution where the individual pixels are visible.
Set the stretch mode to viewport, aspect to keep, and integer scaling mode.
Turn 2D pixel snapping on.
Display objects with different motion than the camera like a parallax node.
Scroll around.

Minimal reproduction project (MRP)

This is set up with engine speed at a 0.1 multiplier and printing the positions of both the parallax node and the camera, and the difference between the two when pixel snap is active.
You can see while you're scrolling that the difference between the two jumps back and forth between two values.

camerajitter.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants