Project

General

Profile

Actions

Emulator Issues #12725

open

Pixel Perfect / Integer Scaling mode

Added by tccalvin about 3 years ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

Hey there, Dolphin people!

Lately I've been playing around with Dolphin on an old 4:3 CRT computer monitor and I'm having a lot of fun. Playing games in 480p with progressive scan is just fantastic.

With that said, in my quest to get the most accurate, console-like experience out of the emulator and the monitor I came across an issue that probably doesn't bother a lot of people, but I felt it was worth mentioning anyhow.

I don't really know what the proper place to post this finding is, but I'll put it here for now. Also, I'm by no means an expert on any of the things I'm about to show, so I'd appreciate it if someone more knowledgeable could correct me.

What I found is this: there is no way to consistently display games in 480p without some sort of scaling taking place (I'm guessing it's bilinear filtering but I'm not sure).

Here are the tests I did (you might have to zoom on the pictures to see the scanlines):

Booted up Sonic Riders in a 640x480 fullscreen window with the aspect ratio set to "Auto" and I got these scaling artifacts:

https://imgur.com/a/M8TeXme

(Notice the uneven pixel crawl, the blue halo around Sonic and the dark halo around the light beam)

By taking a screenshot, I figured out that the native resolution of the game is 584x480, so I tried the "Force 4:3" and "Stretch To Window" modes and the poor scaling went away on the stretched image:

https://imgur.com/a/rcYScxk

(Notice the even pixel crawl, and how the edges have perfect contrast with no halo)

I don't really know why this worked. My only guess is that it might have something to do with a CRT not having a fixed pixel structure.

Sadly, this trick only works with games that have to be stretched horizontally.

I took a screenshot of Mario Sunshine and found out its resolution is 640x476, which means that a couple of lines of pixels are cut from the top and bottom part of the screen. This doesn't sound like a big deal at first. However, with how Dolphin's video modes work, this ends up messing up the entire image.

Whereas Sonic Riders was scaled horizontally in "Auto" mode, Mario Sunshine is always scaled vertically no matter what aspect ratio you choose:

"Auto":

https://imgur.com/a/2A4MhyA

"Force 4:3" and "Stretch To Window":

https://imgur.com/a/NMSf1f3

(Notice the uneven pixel crawl and the red halo above Mario, or the dark one above his shoes and his shadow)

I'm guessing all of this could probably be fixed by implementing a Pixel Perfect / Integer Scaling mode. This way, all the pixels that aren't used would simply be black, and all the active pixels would line up with the scanlines or the pixel grid of the display. This wouldn't just benefit CRT users, but also owners of 480p LCDs and people who use HD TVs / monitors who don't mind having black bars around the image.

I know this feature is probably not as easy to implement as it sounds, but it would be a welcome one nontheless. But maybe there are other ways...?

I'm looking forward to your feedback! :)

P.S. "Crop" doesn't fix this, if anything it introduces more scaling on both axes...


Files

0integerscaling.glsl (778 Bytes) 0integerscaling.glsl taolas, 06/05/2022 09:15 PM
integerYbilinearX.glsl (1.41 KB) integerYbilinearX.glsl taolas, 06/05/2022 10:16 PM
bad_ps_5_0_D3D_0.txt (3.12 KB) bad_ps_5_0_D3D_0.txt tccalvin, 06/05/2022 11:05 PM
0_IntegerScalingOPTIONS.glsl (3.03 KB) 0_IntegerScalingOPTIONS.glsl taolas, 06/06/2022 08:55 AM
00_Integer_Scale_CRT.glsl (3.19 KB) 00_Integer_Scale_CRT.glsl taolas, 06/10/2022 09:26 PM

Related issues 1 (0 open1 closed)

Has duplicate Emulator - Emulator Issues #12861: [Feature Request] Add support for integer scaling and nearest neighbor filteringDuplicate

Actions
Actions

Also available in: Atom PDF