8000 Add option to not fill the entire screen, only the amount of pixels of the selected resolution AKA pixel perfect mode · Issue #6612 · ihhub/fheroes2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add option to not fill the entire screen, only the amount of pixels of the selected resolution AKA pixel perfect mode #6612

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

Open
1 task done
zenseii opened this issue Feb 12, 2023 · 7 comments
Labels
improvement New feature, request or improvement pixel-precision Fine-tuning of UI elements and assets ui UI/GUI related stuff
Milestone

Comments

@zenseii
Copy link
Collaborator
zenseii commented Feb 12, 2023

Preliminary checks

Describe the problem requiring a solution

We should consider adding the possibility to not stretch the image to fill the screen in the vertical direction too. Currently if you select 1280x960 in fullscreen mode on a 1920x1080 screen the image will be stretched to fill the entire height of the screen, instead of leaving two horizontal borders of 120/2 px above and below the image. Please correct me if I'm wrong about this @oleg-derevenetz.

Now that we have integer scaling available I believe it makes sense to have such a "pixel perfect" mode available so that the users who want to can have the sharpest image possible with no stretching/non-integer upscaling. I realize some of this might be dependent on the gpu driver options?

A similar example is how the campaign videos are kept in the original resolution without stretching/upscaling when you have a higher resolution than 640x480 selected. Ideally it should be possible to have these videos upscaled too to match the selected resolution, this might be another issue all together.

If anything I think we should figure out how to make the current image options and the future ones as simple and as easy to understand for the users as possible.

Relates to #5373 and #6516 and #6586 (comment)

Describe the possible solution

Points:

  1. Decide if we need a non-stretched mode. Potentially implement it.
  2. Figure out how to make all the scaling and image related options streamlined, like filters, aspect ratios, integer scaling.

Additional info

No response

@zenseii zenseii added improvement New feature, request or improvement ui UI/GUI related stuff labels Feb 12, 2023
@zenseii zenseii added this to the 1.0.2 milestone Feb 12, 2023
@ihhub ihhub modified the milestones: 1.0.2, 1.0.3 Mar 12, 2023
@ihhub ihhub modified the milestones: 1.0.3, 1.0.4 Apr 11, 2023
@ihhub ihhub modified the milestones: 1.0.4, 1.0.5 May 13, 2023
@ihhub ihhub modified the milestones: 1.0.5, 1.0.6 Jun 14, 2023
@ihhub
Copy link
Owner
ihhub commented Jun 20, 2023

Hi @zenseii , is this issue still valid after the latest resolution changes?

@zenseii
Copy link
Collaborator Author
zenseii commented Jun 20, 2023

Hi, @ihhub. It has indeed been fixed with the latest resolution changes. I'm not sure which one it is, for later reference, but now I can select 640x512 (x2.0) and this gives perfectly square pixels by adding borders above and below the image.

It should be noted that people should use the "nearest" filtering mode to achieve unblurred pixels, and this is only available thru the config file fheroes2.cfg.

image

We should maybe open a separate issue/discussion about whether we should always add borders to the side as well for resolutions like the one shown above. I'm not sure if this is even possible.

@zenseii
Copy link
Collaborator Author
zenseii commented Jun 20, 2023

The only point still standing from my OP is about adding the option to switch between filters in the options, instead of having it locked behind fheroes2.cfg. All the other points have been solved.

@zenseii
Copy link
Collaborator Author
zenseii commented Jun 20, 2023

I see adding an option to switch between the filters has already been requested here: #4946 and #5656 so I'm closing this issue.

@zenseii zenseii closed this as completed Jun 20, 2023
@zenseii zenseii reopened this Jun 20, 2023
@zenseii
Copy link
Collaborator Author
zenseii commented Jun 20, 2023

Actually, I looked closer and it seems the issue about square pixels isn't solved. If you look closely at my picture above you can spot both horizontal and vertical pixels that aren't square when using 640x512 (x2.0):
This part of the Y that is 3 pixels wide (x-direction) instead of 2:

x-direction

image

And this line is 3 pixels tall (y-direction) instead of 2:

y-direction

image

Meanwhile I noticed that when in windowed mode the pixels are perfectly square.

The solution for a screen with a resolution of 1920x1080 px is to have the resolution of "640x480 (x2.0)" together with vertical borders above and below with each a height of 60 px so that you get 480 * 2 + 60 + 60 = 1080.

Currently for me 640x480 (x2.0) produces a stretched image without borders:

Click for 640x480 (x2.0) image

image

@zenseii
Copy link
Collaborator Author
zenseii commented Jun 20, 2023

I went and simply added the resolution of 640x540 in my Intel GPU driver settings (this laptop has intel iGPU with Nvidia dGPU) and lo and behold I was able to get perfect square pixels with borders that are 60px wide:
image

In other words I needed the resolution that was 640 x (480 + 30 + 30) = 540, which becomes 1280x1080 when multiplied by 2.

@ihhub ihhub modified the milestones: 1.0.6, 1.0.7 Jul 15, 2023
@ihhub ihhub modified the milestones: 1.0.7, 1.0.8 Aug 14, 2023
@zenseii
Copy link
Collaborator Author
zenseii commented Aug 20, 2023

Here are some additional notes:

  1. When using 960x540 (2.0x or not doesn't matter), which is generally the recommended for 1920x1080px screens, we have no issues in the adventure map, nor any other instance, except for the main menu background (*and credits, see edit below) which is stretched both vertically and horizontally.

The Sword's blade makes it pretty obvious (640x540 to the left, 960x540 to the right):
sword

I've highlighted this in the Q from the quit button using nearest filtering:

Q letter

Pixel perfect 640x540 with borders above and below the background:
image
Stretched image in 960x540 (2.0x and not, it doesn't matter):
image

  1. The problem with 640x540 is that it obviously doesn't have the width of the adventure map that 960x540 has. The solution is obviously to make sure that the 960x540 modes have vertical borders in the main menu in addition to horizontal borders.

EDIT: Actually the Credits suffer from this too since they are stretched. Take a look at the fheroes2 engine text:

Credits text

Pixel perfect 640x540:
image

Stretched 960x540 (2.0x and not):
image

@zenseii zenseii added the pixel-precision Fine-tuning of UI elements and assets label Aug 20, 2023
@ihhub ihhub modified the milestones: 1.0.8, 1.0.9 Sep 11, 2023
@ihhub ihhub modified the milestones: 1.0.9, 1.1.0 Oct 11, 2023
@ihhub ihhub modified the milestones: 1.1.0, 1.1.1 May 22, 2024
@ihhub ihhub modified the milestones: 1.1.1, 1.1.2 Jul 13, 2024
@ihhub ihhub modified the milestones: 1.1.2, 1.1.3 Sep 15, 2024
@ihhub ihhub modified the milestones: 1.1.3, 1.1.4 Oct 23, 2024
@ihhub ihhub modified the milestones: 1.1.4, 1.1.5 Nov 27, 2024
@ihhub ihhub modified the milestones: 1.1.5, 1.1.6 Dec 30, 2024
@ihhub ihhub modified the milestones: 1.1.6, 1.1.7 Feb 16, 2025
@ihhub ihhub modified the milestones: 1.1.7, 1.1.8 Mar 23, 2025
@ihhub ihhub modified the milestones: 1.1.8, 1.1.9 May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement New feature, request or improvement pixel-precision Fine-tuning of UI elements and assets ui UI/GUI related stuff
Projects
None yet
Development

No branches or pull requests

2 participants
0