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

Godot doesn't support custom screen resolution #24720

Closed
miskatonicstudio opened this issue Jan 2, 2019 · 8 comments
Closed

Godot doesn't support custom screen resolution #24720

miskatonicstudio opened this issue Jan 2, 2019 · 8 comments

Comments

@miskatonicstudio
Copy link

Godot version:

3.0.6

OS/device including version:

Linux Pop!_OS 17.10 (Artful Aardvark)

Issue description:

For now it seems that Godot supports 2 modes for 3D: fixed resolution (with fullscreen off) or stretch (covering the entire screen, with fullscreen on). Modern games often offer a specific resolution in fullscreen (being able to play with 1280x720 when the screen resolution is 1920x1080). Is this supported in Godot too?

Steps to reproduce:

Minimal reproduction project:

@Calinou
Copy link
Member

Calinou commented Jan 2, 2019

Is this supported in Godot too?

Yes, using the viewport stretch mode; see Multiple resolutions in the documentation.

Note that this will use nearest-neighbor upscaling, which isn't suited to games that don't follow a "pixel art" aesthetic. To use linear upscaling instead, it's possible to create a custom viewport, but the Project Settings currently don't offer a way to do that out of the box.

@miskatonicstudio
Copy link
Author

I'm afraid that's not what I meant. The game should be able to run in a custom resolution in fullscreen, as long as that resolution is supported by the monitor. Example:

  • open the game in fullscreen in full HD (1920x1080), which is the maximum resolution of the monitor
  • take a screenshot => it saves as an image 1920x1080
  • still in fullscreen, change the game's resolution to 1280x720 (assuming that the monitor supports it)
  • take a screenshot => it saves as an image 1280x720

The problem is not with stretching the content of the screen, but with actually changing the resolution of the screen. Is such a thing possible with Godot?

@Calinou
Copy link
Member

Calinou commented Jan 3, 2019

Changing the monitor resolution would imply supporting exclusive fullscreen, which is not currently supported by Godot: #14542

Keep in mind there are many practical downsides to using exclusive fullscreen:

  • Switching resolutions or alt-tabbing requires mode setting, which turns the screen black for a few seconds. This makes frequent alt-tabbing inconvenient.
  • You have little to no control over how the viewport is stretched: most monitors will upscale the image with linear filtering, and will stretch it if its aspect ratio doesn't match the monitor's (which causes distortion).
  • It's poorly-supported on Linux and macOS, so this is mostly considered to be a Windows-only feature at this point.

This is why a lot of modern games tend to be moving away from it, promoting the use of a borderless window with an upscaled viewport instead, even if it's slightly slower.

@miskatonicstudio
Copy link
Author

It's been a while, but while working on a new project I've noticed how much the game slows down on my very-not-high-end machine. Has there been any development/any decisions made with implementing exclusive fullscreen in Godot?

@Calinou
Copy link
Member

Calinou commented Feb 2, 2020

@miskatonicstudio There are still no plans to add exclusive fullscreen to Godot. You can change your display resolution manually if you run into performance issues on hiDPI displays. It's not as convenient, but considering it's an edge case, I don't see much point in making it a built-in feature (similar to things like hardware gamma). You could write a script or program to do this automatically when a given process is started or exited 🙂

Also, which resolution are you rendering the game at?

@Calinou
Copy link
Member

Calinou commented Feb 2, 2020

I just noticed this issue is a duplicate of #14542, so I'll close it.

@miskatonicstudio
Copy link
Author

Thank you for your answer @Calinou . I don't mind changing the screen's resolution before running a game (I'm a Linux user, I'm used to all kinds of workarounds ;) ), but I don't think I can demand that of users/gamers. I think most games nowadays still support changing the resolution of the screen in fullscreen mode, to make your game run faster or the interface elements look bigger. I can understand, however, that Godot doesn't want to add this feature. I will experiment with viewport scaling and see if I can get the performance I want ;)

@Calinou
Copy link
Member

Calinou commented Feb 7, 2020

to make [...] the interface elements look bigger.

This is handled automatically by Godot if you use the 2d or viewport stretch mode. See Multiple resolutions for more information. If you'd like to control the scaling factor manually when using the disabled or 2d stretch modes, this will be available once #21446 is merged.

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

3 participants