-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Assets are being distorted on monitors that are not a 16 * 9 aspect ratio when Window is on Viewport / Expand mode #63579
Comments
The distortion is due to fractional pixel scaling. It's not a matter of aspect ratios here, so the The
To disable any kind of scaling, set the stretch mode to If you want manual control over the size of the 2D game world depending on resolution, adjust a Camera2D node's zoom property based on window size (using the lowest dimension of width and height in your case). |
My game's assets are pixel art, which is why I had the Viewport and Aspect settings set this way. When I change the Stretch Mode to 2D from Viewport, the text starts to look better, but the lines drawn at the edges of the game board are still distorted. I suppose that if nothing can be done, then I will just leave it as is. I suspect that most of my users will have a 16*9 display, and this will be a moot issue. |
I was under the assumption that if you had the settings set to Viewport / Expand that Fractional Pixel Scaling wouldn't happen because it would only scale if it was able to maintain the aspect ratio. |
Godot doesn't feature integer scaling yet. Therefore, for proper pixel art scaling, you need to install and configure https://github.com/Yukitty/godot-addon-integer_resolution_handler. |
Ok, Thanks. I will try it out. Should I close this issue then? |
Thank you very much for the assistance too. It is very appreciated. |
Godot version
v3.4.4.stable.official [419e713]
System information
M1 Macbook Air 2020
Issue description
I am working on a project that is going to be released on Mobile and on PC / Mac / Linux.
Following the documentation here, I put my Stretch Mode to Viewport and the Aspect to Expand, and I have also set the base resolution of the game to 720 * 720, as I wish to support both portrait and landscape displays.
720p is a 16 * 9 resolution, and when I run my game on a 16 * 9 aspect display, the game looks pristine. But when I run my game on a monitor that has a 16 * 10 aspect ratio, there is some distortion of the assets.
Based on the documentation that I linked, the expectation is that if I have my Window settings set to Viewport / Expand, the engine is supposed to not scale the assets and instead show more of the negative space (kind of like a camera being pulled back from a subject). It seems that even on Viewport / Expand mode, some scaling is being applied to the textures and assets in the scene.
My Desktop PC has a Portrait and Landscape 1440p monitor
My laptop has a 16 * 10 monitor, which is where I see the distortion of the assets.
Here is the game running at 1440p landscape (no distortion)
Here is the game running at 1440p portrait (no distortion)
Here is the game running on my laptop at 1440 * 900 (distortion)
You can see the distortion in the lines being drawn on the game board, and on the text.
Steps to reproduce
Start a new project, set its window size to 720 * 720
Put the Window mode on Viewport / Expand
Run the game on a monitor that has a different aspect ratio than 16 * 9
Minimal reproduction project
I have attached a sample project that can be run to see the distortion when run in full screen on a monitor that is 16 * 10.
Sample Project.zip
The text was updated successfully, but these errors were encountered: