-
-
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
Scaling artifacts when viewport is scaled up and texture filtering is disabled #79726
Comments
I can confirm this on 4.2.dev 0f7625a (Linux, GeForce RTX 4090 with NVIDIA 535.54.03). This occurs with all rendering methods, regardless of whether the 2D pixel snap project settings are enabled (either of them, or both). The issue occurs when the window size is odd on one of the dimensions (or both). That said, I'm not sure if this can be resolved. You probably need something like integer scaling or sharp bilinear filtering to avoid this issue. Do other engines have this issue when using odd window sizes with no scaling? |
I tried adding this line which rounds the window size to an even number, and as expected it hides the problem.
It's not too noticeable so it might not be a bad temp solution, though I'm not sure of the performance implications of running it every frame. |
You can create a Control node whose anchors and offsets are configured to be in Full Rect and connect its Viewport also has a That said, most methods in Godot have no-op checks if the new value is identical to the current one, and will do nothing in that case. |
I can still reproduce this on 4.3.dev 8f0c20e (Linux), even after enabling Snap 2D Transforms to Pixel and Snap 2D Vertices to Pixel in the Project Settings. This occurs with all rendering methods. Therefore, #87297 didn't appear to resolve this particular issue. Changing stretch scale policy to For reference, the issue also occurs if Centered is disabled on the Sprite2D. The MRP doesn't feature any Camera2D. |
Could this be affected by the operating system DPI scaling? Maybe we're ending up with an odd window size due to that? |
I'm using 100% scale on KDE X11, so it's not related to that. I've also tried using borderless mode and can still reproduce the issue (using Alt + Right mouse button to resize the window while in borderless mode). Also, it's interesting to note the duplicated pixels are always in the center of the viewport. |
Godot version
v4.1.1.stable.official [bd6af8e]
System information
Windows 10
Issue description
I created a 2d scene that has texture nodes, and those texture nodes have their filter set to "nearest".
In Project Settings > General > Display > Window > Stretch > Scale, I have set this to 2.
when you start resizing the window, you notice this line of stretched/squashed pixels start to move:
My theory is that this is happening when the window is stretched to an uneven width/height? The seam of distorted pixels seems to always be in the center of the screen.
Steps to reproduce
Minimal reproduction project
test_game.zip
The text was updated successfully, but these errors were encountered: