-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Blurred sprite after movement #66527
Comments
Floating point imprecision, I guess? Delta is a floating point value and so is get_action_strength. Does floor() (or ceil() or casting to int()) fix the issue? You could also try snapping to grid via the toolbar button. |
Related to #57221. This is a difficult problem to solve: #57221 (comment) @lorenzo-arena Please upload a minimal reproduction project to make this easier to troubleshoot. |
Here is a simple project which reproduces the problem:
I also tried to see if rounding fixes the issue and in fact it does: using
instead of
doesn't produce the issue anymore. |
Also using |
@Calinou should this be solved (even when using |
IMO the snap options should eliminate this artifact entirely. |
To give a couple more informations on this.. In the reproduction project I use a structure like:
where the viewport has the pixel art canvas size set as the size (256x144). Stretch mode is set to viewport, and the output resolution is set to 1280x720. In other projects if I try to set stretch mode to viewport, window size to something low res like 256x144 and then the test size to 1280x720 the blurriness don't happen. Why is this happening? Shouldn't the viewport behave in the same way? |
Using the Also, the pixel snap options are set on a per-viewport basis. The project setting only affects the root viewport; you need to enable the pixel snap properties on the SubViewport if you wish it to behave the same way. |
Actually snapping on the right viewport seems to work, yes. I have to snap the position; vertex snapping doesn't seem to have any effect. |
I'm not sure this is still relevant, but in Godot 4, switching the stretch mode to |
@dewald-els this is true but using |
I'm now experiencing this issue and been searching for ages for a way to fix it |
I took a look at this locally and it turns out that the Viewport was mistakenly configured use linear for the default filter. The pumpkin is configured to inherit the default value while the wall is set to use nearest. Setting the pumpkin to use nearest or setting the default to nearest makes the issue go away |
Godot version
4.0-beta1
System information
PopOS 22.04, Ryzen 3700U Vega 10 iGPU
Issue description
I'm trying to make a simple 2D pixel art movement; I have a sprite against a background and the sprite can be moved only sideways. Sometimes, but not always, after a movement when the pumpkin stops it gets blurred as in the picture (it's not moving there). Sometimes instead it is sharp and clear. Filter settings for the texture are good for pixel art, which gets rendered correctly.
Steps to reproduce
I used a CharacterBody2D with a sprite node as a children. The body has a script attached to it to move:
Minimal reproduction project
godot-66527-minimal.zip
Production edit: added the MRP to the description.
The text was updated successfully, but these errors were encountered: