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

Fix sprite crunch at half-pixels #86670

Closed
wants to merge 1 commit into from

Conversation

adamscott
Copy link
Member

@adamscott adamscott commented Dec 31, 2023

Rounds the canvas item position for nearest filtered textures before rendering it.

Fixes #84632

@adamscott adamscott added this to the 4.x milestone Dec 31, 2023
@adamscott adamscott requested a review from a team as a code owner December 31, 2023 18:31
@adamscott adamscott force-pushed the fix-sprite-crunch branch 2 times, most recently from 6a1f9e6 to de24824 Compare January 1, 2024 02:15
@Calinou
Copy link
Member

Calinou commented Jan 1, 2024

Out of curiosity, why is this only done when the filter mode is Linear and not Nearest?

@adamscott adamscott marked this pull request as draft January 3, 2024 17:57
@adamscott
Copy link
Member Author

Out of curiosity, why is this only done when the filter mode is Linear and not Nearest?

My bad, I just found out that I mixed up Linear and Nearest. I meant to do this on Nearest only.

Nearest:
Capture vidéo du 2024-01-04 13-54-09.webm

Linear (I don't want to round up, because it will look like nearest if I round up (without the pixelated inbetweens):
Capture vidéo du 2024-01-04 13-54-35.webm

@clayjohn
Copy link
Member

clayjohn commented Jan 5, 2024

I think this should be tucked behind a check for rendering/2d/snap/snap_2d_transforms_to_pixel.

For performance reasons we should cache the result of course and add a method to enable pixel snapping inside the rendering server.

@adamscott
Copy link
Member Author

#84380 is better suited to fix #84632.

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.

Sprite "crunch" when placed in certain positions on screen
4 participants