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

[3.4] Incorrect sub-pixel drawing behavior using display/window/stretch/shrink setting #54785

Closed
sjerpsthomas opened this issue Nov 8, 2021 · 3 comments

Comments

@sjerpsthomas
Copy link

Godot version

3.4.stable

System information

Windows 10, GLES3, GeForce GTX 1660 SUPER

Issue description

When stretching the screen in the settings (using the parameter display/window/stretch/shrink), sub-pixel drawing behaviors are no longer drawn with stretched pixels.
Instead, they are drawn as if the pixel stretch were set to 1, and the camera were zoomed in.

The images below illustrate a scene with a drawn line and a scaled-down sprite, using a screen stretch of 4.

Behavior in Godot 3.3.2.stable

image

Behavior in Godot 3.4.stable

image

More detailed system information

Version: Godot Engine v3.4.stable.official.206ba70f4
OpenGL ES 3.0 Renderer: GeForce GTX 1660 SUPER/PCIe/SSE2
OpenGL ES Batching: ON
OS: Windows 10 Home 21H1, 19043.1288
Processor: Intel Core i7-6700 @ 3.40 GHz
Graphics card: NVIDIA GeForce GTX 1660 SUPER
Graphics card driver version: 27.21.14.5671

Steps to reproduce

  1. In a new scene, place a downscaled sprite / instance of draw_line / ...
  2. Increase the screen stretch in the settings or with get_tree().set_screen_stretch(...).
  3. Run the scene. Note the visual change between 3.3 and 3.4.

Minimal reproduction project

ScreenStretchMinimalReproducableProject.zip

@sjerpsthomas sjerpsthomas changed the title Incorrect sub-pixel drawing behavior with display/window/stretch/shrink [3.4] Incorrect sub-pixel drawing behavior with display/window/stretch/shrink Nov 8, 2021
@sjerpsthomas sjerpsthomas changed the title [3.4] Incorrect sub-pixel drawing behavior with display/window/stretch/shrink [3.4] Incorrect sub-pixel drawing behavior using display/window/stretch/shrink setting Nov 8, 2021
@Calinou
Copy link
Member

Calinou commented Nov 8, 2021

Following the merge of #52137, this is now expected when not using the viewport stretch mode. If you want a pixel art appearance, set the stretch mode to viewport in the project settings.

cc @Ansraer

@sjerpsthomas
Copy link
Author

@Calinou Alright, I've set the stretch mode to viewport now, and the scene now has a pixel art appearance, as before.
However, changing the screen stretch through get_tree().set_screen_stretch(...) now causes the game to stop rendering.
The scene still processes and takes input, but the graphics do not refresh, and when resizing the window, it turns black.

The project with updated settings:
ScreenStretchMinimalReproducableProject.zip

@Calinou
Copy link
Member

Calinou commented Nov 8, 2021

However, changing the screen stretch through get_tree().set_screen_stretch(...) now causes the game to stop rendering.

Double-check that your graphics driver isn't forcing MSAA on Godot: #18320

@Calinou Calinou removed this from the 3.4 milestone Nov 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants