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

Super Mario 64 - Misaligned pixels in HUD with certain resolutions with 213c10d6 #2517

Closed
IronYoshi64 opened this issue Jun 13, 2021 · 5 comments

Comments

@IronYoshi64
Copy link

In Super Mario 64 USA, using the current latest master branch of GLideN64 which is 213c10d, there are some misaligned and incorrect pixels in the Hud.

Here is a screenshot at 1152 x 864 with the misaligned pixels:
GLideN64_SUPER_MARIO_64_000

So I tried going through all the windowed size resolutions to see which ones had issues. Here is what I noticed:
320 x 240 - looks fine
400 x 300 - has issues
480 x 360 - has issues
640 x 480 - looks fine?
800 x 600 - has issues
960 x 720 - looks fine
1024 x 768 - has issues
1152 x 864 - has issues
1280 x 960 - looks fine?
1280 x 1024 - looks fine
1440 x 1080 - has issues - cropping off some of top
1600 x 1024 - looks fine?
1600 x 1200 - can't tell - cropping off a lot of the top

Also trying an older version of GLideN64, rev. 1d90610, this seems to not be an issue.

Here is a screenshot at 1152 x 864 using 1d90610:
GLideN64_SUPER_MARIO_64_001

@gonetz
Copy link
Owner

gonetz commented Jun 14, 2021

It seems that the HUD "looks fine" only in multiple of native resolution.
@standard-two-simplex strongly advices use only multiples of native.
I'm thinking about adding a new mode for the option Internal resolution=> Multiple of N64 resolution: Auto.
It should pick such a multiple of native res that the output resolution is greater or equal to the selected display resolution.
For example, if game uses 320x240 resolution and display resolution is 1024x768, the internal resolution will use 4x multiple.
Hybrid filter should correctly downscale it to 1024x768.
If the game switches from 320x240 to a higher resolution, say 640x480, the multiple should automatically be reduced to 2.
Currently, user selected multiple is the same for all native resolutions. which may cause performance issues.

@ghost
Copy link

ghost commented Jun 17, 2021

there are some misaligned and incorrect pixels in the Hud

This is natural whenever you render with a non native resolution. Suppose you have a square 14 pixels high and the texture is 10 pixels high. If the primitive is set to nearest neighbour filtering, you will have to repeat for rows of pixels, which will make the output feel awkwardly aligned. If the primitive is set to a bilinear filter, the pixels will mix with its neighbours, so it will look blurry.

Even rendering in 2x becomes difficult, because the developers didn't design the games with upscaling in mind. As a result, hidden "bugs" manifest solely because you're rendering in non-native resolutions.

Many PC games than can be rendered in different resolutions use a fixed sized HUD to overcome this limitation, so if you choose a big resolution, the HUD will be smaller in proportion.

Also trying an older version of GLideN64, rev. 1d90610, this seems to not be an issue.

I can't see any considerable difference between the two pictures you posted. Considering it is impossible to have a 1:1 correspondence in such resolutions, no artifacts seems good enough for me.

Multiple of N64 resolution: Auto.

I agree, this approach is probably the best option for a reasonable upscaling without getting a huge performance penalty. However, it might not be necessary that the output resolution to be bigger than the display resolution. As long as both resolutions are close, it might not matter much whether you upscale or downscale the output image to the display.

@IronYoshi64
Copy link
Author

I can easily see the differences. Like the pixels in the star hud is incorrect and some pixels are either stretched or cropped off like for the coin and mario head. Also yeah, I hope that option Multiple of N64 resolution: Auto is gonna fix this stuff when that gets in :)

@weinerschnitzel
Copy link

weinerschnitzel commented Jun 19, 2021

I see them too, you had to point it out though. But I think the point here is that non multiples of internal resolution should not be correct, and multiples may not be correct if there is not a good heuristic used to upscale, and depending on the game.

Hopefully we can achieve pixel accuracy as good as parallel rdp upscaled with multiples of internal res.

I imagine that the suggested solution to get near the output resolution or greater and use hybrid filter would add some blurring, but I may not be fully knowledgeable on hybrid filter itself and need to reread.

If Auto pans out, perhaps setting your own resolution should be removed from UI.

@IronYoshi64
Copy link
Author

This is I believe fixed now in more recent builds. Closing this unless it comes back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants