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

Add pixel snap for Parallax2D #94014

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

markdibarry
Copy link
Contributor

@markdibarry markdibarry commented Jul 6, 2024

This is one temporary solution for parallax jittering, partially fixing #94005.

One way to fix the discrepancy between camera and canvas items with odd motion speeds is by manually setting the camera's position to the snapped value, so anything that depends on the camera's position also gets the snapped value. This is a brute force method and may create problems with other systems, so I'd like to avoid it until we know for sure it wouldn't be an issue, or can find an alternative.

Parallax2D depends on the camera's position, but sets the node's position every time the camera moves, so there's no harm in passing a snapped value to the parallax node. Until we have a long-term solution, this will prevent jitter for parallax movement while pixel snap is turned on.

After:

2024-07-07.10-20-06.mp4

Copy link
Member

@adamscott adamscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In line with the latest fixes for pixel snapping. This seems legit and good to me, so let's go!

@akien-mga akien-mga merged commit ff8050e into godotengine:master Jul 9, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@markdibarry markdibarry deleted the parallax-snap branch July 9, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants