Poll about prefered scaling quality

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, spiny, Greenious, Sorgelig, Moderator Team

What scaling quality you like more

Polyphase like in release before 20181015
10
36%
Near Neighbor like in release 20181016
18
64%
 
Total votes: 28

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Poll about prefered scaling quality

Postby Sorgelig » Wed Oct 17, 2018 6:27 pm

Use Genesis core releases 20181015 and 20181016

ghogan42
Atariator
Atariator
Posts: 29
Joined: Wed Oct 17, 2018 7:27 pm

Re: Poll about prefered scaling quality

Postby ghogan42 » Wed Oct 17, 2018 7:41 pm

Hi, I've just recently discovered MiSTer. Well not really since I've followed emulation and fpga projects since the 90s. But I'm currently looking to source some of the needed boards and make a purchase.

I don't want to come across as abrasive, but nearest neighbor scaling is just stupid in a project like this. I know that you (Sorgelig) knows about all of the problems with it because I've read the threads where you've explained to people that the result of nearest neighbor scaling is that some pixels will get a (for example) 3x scaling and some will get a 4x scaling. And with 100% certainty, that will mean massive shimmering when scrolling and generally messed up graphics for any art that has patterns/dithering.

But you have a number of forum regulars touting nearest neighbor scaling as "OMG SO SHARP. OTHER SCALING BAD". It's crazy...

I know nobody cares about what I'd prefer obviously, but if proper image scaling is removed and cores are going to use nearest neighbor scaling then you might as well run your games in nesticle or MAME 0.37 since the output quality would be identical.

I wouldn't care if I could compile the cores with scaling for free, but we can't. So I'll be basing my purchase decision on the outcome of this. I can't believe that "no scalar" at all is even an option to consider. But it's not my project :shrug:

BitsNStuff
Retro freak
Retro freak
Posts: 12
Joined: Tue Oct 16, 2018 7:55 am
Contact:

Re: Poll about prefered scaling quality

Postby BitsNStuff » Wed Oct 17, 2018 7:50 pm

I have to say that for me NN is definitely preferential.

I think shimmering is a natural byproduct of NN without having integer scaling on both axis or a good quality interpolation solution, both of which are incredibly complex to achieve. These are all just the natural side effects of plying analogue games on digital displays that they were never really designed to be played on, whatever you do it's never really going to be perfect.

Personally though, the slight imperfections of nearest neighbour is preferential to the slight imperfections of polyphase.

vanfanel
Atari User
Atari User
Posts: 42
Joined: Tue Oct 09, 2018 10:19 pm

Re: Poll about prefered scaling quality

Postby vanfanel » Wed Oct 17, 2018 8:38 pm

ghogan42 wrote:The result of nearest neighbor scaling is that some pixels will get a (for example) 3x scaling and some will get a 4x scaling. And with 100% certainty, that will mean massive shimmering when scrolling and generally messed up graphics for any art that has patterns/dithering.




This is EXACTLY what I am seeing, and there's more people noticing the same problems. The project is getting damaged from this decision: NN has no sense at all because of the massive shimmering it causes in graphical patterns.

And, worse of all, we can't do our own builds because Quartus Standard is +2000USD! So it's a dead-end if only NN is available.

cacophony
Atari maniac
Atari maniac
Posts: 85
Joined: Sun Jul 22, 2018 11:14 pm

Re: Poll about prefered scaling quality

Postby cacophony » Wed Oct 17, 2018 8:59 pm

ghogan42 wrote:Hi, I've just recently discovered MiSTer. Well not really since I've followed emulation and fpga projects since the 90s. But I'm currently looking to source some of the needed boards and make a purchase.

I don't want to come across as abrasive, but nearest neighbor scaling is just stupid in a project like this. I know that you (Sorgelig) knows about all of the problems with it because I've read the threads where you've explained to people that the result of nearest neighbor scaling is that some pixels will get a (for example) 3x scaling and some will get a 4x scaling. And with 100% certainty, that will mean massive shimmering when scrolling and generally messed up graphics for any art that has patterns/dithering.


So what you're saying is you have a strong opinion on something you've never tried. I've seen plenty of shimmering on other hardware, but I do not see shimmering with NN scaling on MiSTer in the Genesis, TG-16, NES, or SMS cores.

ghogan42 wrote:I know nobody cares about what I'd prefer obviously, but if proper image scaling is removed and cores are going to use nearest neighbor scaling then you might as well run your games in nesticle or MAME 0.37 since the output quality would be identical.


That makes no sense. The advantage of FPGA is zero lag and higher gameplay accuracy (assuming well implemented). Scaling is entirely orthogonal.

vanfanel
Atari User
Atari User
Posts: 42
Joined: Tue Oct 09, 2018 10:19 pm

Re: Poll about prefered scaling quality

Postby vanfanel » Wed Oct 17, 2018 9:05 pm

cacophony wrote: I've seen plenty of shimmering on other hardware, but I do not see shimmering with NN scaling on MiSTer in the Genesis, TG-16, NES, or SMS cores.



That proves you don't know what's happening here: The TG-16, NES and SMS cores are STILL safe from this horrid NN scaling method.

cacophony
Atari maniac
Atari maniac
Posts: 85
Joined: Sun Jul 22, 2018 11:14 pm

Re: Poll about prefered scaling quality

Postby cacophony » Wed Oct 17, 2018 9:44 pm

vanfanel wrote:
cacophony wrote: I've seen plenty of shimmering on other hardware, but I do not see shimmering with NN scaling on MiSTer in the Genesis, TG-16, NES, or SMS cores.



That proves you don't know what's happening here: The TG-16, NES and SMS cores are STILL safe from this horrid NN scaling method.


Nope, I have custom NN scaling builds for those three cores.The NN change is so appealing to those of us that value the quality of the image output that various people have been doing custom builds of other cores and circulating them.

hubersn
Atari User
Atari User
Posts: 35
Joined: Fri Sep 11, 2015 8:10 pm

Re: Poll about prefered scaling quality

Postby hubersn » Wed Oct 17, 2018 9:57 pm

I don't have any interest in the Genesis core itself, but I would like to understand that scaling issue better.

I have to admit that I don't understand how MISTer HDMI (in general, not in this specific case) currently works. Does it ask the screen via EDID about possible modes, uses the "best" and then scales to this resolution? Or is it possible to force a specific resolution and let the screen worry about the scaling? So if say the Genesis does 240p native and 480p is forced via HDMI (since it is a widely supported HDMI mode often used by DVD players), why would Nearest Neighbour scaling be a bad thing? Hopefully any modern HDMI display worth its salt should be able to scale this sharp source signal to its native panel resolution?

Somehow I guess I am missing something vital in this whole discussion. At the moment, it sounds a lot like Vanfanel's screen with its unusual resolution is just an unlucky case with perhaps a very bad scaling algorithm.

And another question: what is outputted via the VGA signal on the I/O board? Unscaled "original" video like the MIST I guess? Surely this would be the solution for everybody who is unhappy about "nearest neighbour" HDMI scaling?

Thanks in advance for any enlightenment.
hubersn

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Poll about prefered scaling quality

Postby Sorgelig » Wed Oct 17, 2018 10:09 pm

hubersn wrote: Does it ask the screen via EDID about possible modes, uses the "best" and then scales to this resolution? Or is it possible to force a specific resolution and let the screen worry about the scaling?

HDMI resolution is by default 1280x720 and can be changed in MiSTer.ini settings.

hubersn wrote:what is outputted via the VGA signal on the I/O board? Unscaled "original" video like the MIST I guess?

yes, like the MiST.

hubersn wrote:So if say the Genesis does 240p native and 480p is forced via HDMI (since it is a widely supported HDMI mode often used by DVD players), why would Nearest Neighbour scaling be a bad thing? Hopefully any modern HDMI display worth its salt should be able to scale this sharp source signal to its native panel resolution?

For better result with NN scaling higher HDMI resolution is better as uneven scaling difference equal one HDMI pixel. With 1920x1080 there no uneven scaling is noticeable. Actually i don't see it even with 1280x720 resolution on 24" Monitor.

GreyRogue
Atari maniac
Atari maniac
Posts: 82
Joined: Thu Mar 22, 2018 3:50 am

Re: Poll about prefered scaling quality

Postby GreyRogue » Wed Oct 17, 2018 11:05 pm

I've got a solution that should make everyone angry. Alternate between them for each release. :D

Actually, I wouldn't sweat this too much right now. Neither of these is ideal and I'm sure eventually someone will code a better solution (Not sure it would work, but maybe the OSSC code could be ported to this https://github.com/marqs85/ossc. That runs on an Cyclone IV, and glancing at the code it looks like it it uses a single line buffer [minimal BRAM usage]. Wouldn't even need the Altera code then if you can directly access the HDMI pins).

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Poll about prefered scaling quality

Postby Sorgelig » Wed Oct 17, 2018 11:52 pm

If i remember correct OSSC doing just integer scaling and limited to standard input resolutions.

ghogan42
Atariator
Atariator
Posts: 29
Joined: Wed Oct 17, 2018 7:27 pm

Re: Poll about prefered scaling quality

Postby ghogan42 » Thu Oct 18, 2018 2:25 am

GreyRogue wrote:I've got a solution that should make everyone angry. Alternate between them for each release. :D


That would be fun!

Sorry if I offended anybody. I'll add a couple of notes:

(1) I actually do know what I'm talking about. Not "having a strong opinion about something I haven't tried". I've written several crt style scanline shaders for retroarch and MAME. I've had to worry about proper interpolation and how to balance sharpness vs shimmering. Also I'm a mathematician. So I know that Lanczos scaling is about as good as you're going to get. You could minimize ringing around edges but only if you make it blurrier too...

(2) The reason NN looks good for Genesis is because most (if not all) games use 320x240 for their resolution. So when you scale to 720p you get a perfect 3x scaling for both vertical and horizontal directions and a nice 4:3 aspect ratio. Which makes NN scaling work perfectly. But are all Genesis games 320x240? I don't think so. Wouldn't PAL games be different? And genesis has other video modes. I think there is a 256x240 at least. Those won't look good with NN scaling even at 720p.

It's not a great idea to make some games look perfect at the expense of making other games look terrible. That's just an opinion though.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Poll about prefered scaling quality

Postby Sorgelig » Thu Oct 18, 2018 6:04 am

Almost all Genesis games use 224px vertical resolution. I've saw only one 240p game.

ghogan42
Atariator
Atariator
Posts: 29
Joined: Wed Oct 17, 2018 7:27 pm

Re: Poll about prefered scaling quality

Postby ghogan42 » Thu Oct 18, 2018 6:24 am

Sorgelig wrote:Almost all Genesis games use 224px vertical resolution. I've saw only one 240p game.


Oh wow. You're right of course. So no NTSC games would be perfectly integer scaled at 720p then.

I would encourage anybody that thinks NN is the way to go to grab 240P Test Suite from: http://junkerhq.net/xrgb/index.php?title=240p_test_suite (downloads are on GIT, there are links near the bottom). Check out the test patterns (grid, stripes) and especially the scroll tests. That should do a good job of showing off any scaling issues.

cacophony
Atari maniac
Atari maniac
Posts: 85
Joined: Sun Jul 22, 2018 11:14 pm

Re: Poll about prefered scaling quality

Postby cacophony » Thu Oct 18, 2018 6:44 am

ghogan42 wrote:(1) I actually do know what I'm talking about. Not "having a strong opinion about something I haven't tried". I've written several crt style scanline shaders for retroarch and MAME. I've had to worry about proper interpolation and how to balance sharpness vs shimmering. Also I'm a mathematician. So I know that Lanczos scaling is about as good as you're going to get. You could minimize ringing around edges but only if you make it blurrier too...


No doubt, but does it matter when in practice few people notice any issues in this specific use case? NN gives razer sharp pixels with no ringing. So if most users aren't noticing shimmering with their setups then it sounds pretty ideal, or at a minimum preferable to fuzzy output with ringing.

ghogan42 wrote:(2) The reason NN looks good for Genesis is because most (if not all) games use 320x240 for their resolution. So when you scale to 720p you get a perfect 3x scaling for both vertical and horizontal directions and a nice 4:3 aspect ratio. Which makes NN scaling work perfectly. But are all Genesis games 320x240? I don't think so. Wouldn't PAL games be different? And genesis has other video modes. I think there is a 256x240 at least. Those won't look good with NN scaling even at 720p.


As I already mentioned, a number of people have tried NN with various other MiSTer cores with similar success. I've personally tried it with TG-16, NES, and SMS, and didn't notice any real shimmering for those either.
Last edited by cacophony on Thu Oct 18, 2018 8:12 am, edited 2 times in total.

Shamus
Atarian
Atarian
Posts: 5
Joined: Mon Oct 15, 2018 1:55 pm

Re: Poll about prefered scaling quality

Postby Shamus » Thu Oct 18, 2018 7:51 am

I got very much used to the video style before the NN approach and I have to say that I liked it more! My MISter HDMI is hooked up to DVI of a 1280x1024 monitor and I use analog sound. I think that in particular the scan line simulation which is important to me suffers from NN. I'd appreciate if in the future a choice between both modes would remain possible.

vanfanel
Atari User
Atari User
Posts: 42
Joined: Tue Oct 09, 2018 10:19 pm

Re: Poll about prefered scaling quality

Postby vanfanel » Thu Oct 18, 2018 8:41 am

ghogan42 wrote:.

But are all Genesis games 320x240? I don't think so. Wouldn't PAL games be different? And genesis has other video modes. I think there is a 256x240 at least. Those won't look good with NN scaling even at 720p.

It's not a great idea to make some games look perfect at the expense of making other games look terrible. That's just an opinion though.


Try Snow Brows if you want to see a game totally destroyed by this NN nightmare. In fact, you don't need a MiSTer or a 1360x monitor like mine (1360x768 is a very common resolution anyway in HD-capable HDMI monitors that aren't full-HD), because this is maths: get any screen with a native 720p resolution and disable bilinear interpolation in, let's say, RetroArch+GenesisPlusGX core. As you disable bilinear interpolation, everything is wrong, from the scenario graphics to the eyes of the main character, wich look wider or thiner depending on the position of the screen. And there is noticeable shimmering in every scroll sequence in the game.

And this is what the NN advocates "don't mind", because they prefer to have "razor sharp pixels" in games that were NEVER intended to be unevenly scaled on digital displays, which no matter what you says is going to look very bad.
Now, if I had a way to rebuild from sources... But we are being forced into this situation with no alternatives at all.
And look at the numbers of the poll: I am not the only that finds this horrendous.
Last edited by vanfanel on Thu Oct 18, 2018 9:11 am, edited 3 times in total.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Poll about prefered scaling quality

Postby Sorgelig » Thu Oct 18, 2018 9:02 am

vanfanel wrote:But we are being forced into this shitshow with no alternatives at all.

I think you put enough poo on me and MiSTer. Now you can leave and never come back again.

vanfanel
Atari User
Atari User
Posts: 42
Joined: Tue Oct 09, 2018 10:19 pm

Re: Poll about prefered scaling quality

Postby vanfanel » Thu Oct 18, 2018 9:09 am

Sorgelig wrote:
vanfanel wrote:But we are being forced into this shitshow with no alternatives at all.

I think you put enough poo on me and MiSTer. Now you can leave and never come back again.


Post edited. Sorry if I offended you, Sorgelig.

chaos
Atari nerd
Atari nerd
Posts: 46
Joined: Thu Dec 18, 2014 10:09 am
Contact:

Re: Poll about prefered scaling quality

Postby chaos » Thu Oct 18, 2018 9:32 am

You'd probably only want to use integer scaling with nearest neighbor, that way there will be no shimmering, and you get nice sharp image.

The best way would be to use NN to scale to 2x, 3x or 4x resolution (whatever is smaller than final resolution), and then use some form of sinc resampling (Lanczos, ...) to scale the video to final resolution. That way you get best of both methods, unfortunately it will also be hardest to implement.

This should work nicely with 'consoles', but computers like Amiga / Atari that can output quite different resolutions would be really hard to implement ...
** my minimig builds: http://somuch.guru/ **

Locutus73
Captain Atari
Captain Atari
Posts: 170
Joined: Wed Feb 07, 2018 6:13 pm

Re: Poll about prefered scaling quality

Postby Locutus73 » Thu Oct 18, 2018 1:03 pm

chaos wrote:The best way would be to use NN to scale to 2x, 3x or 4x resolution (whatever is smaller than final resolution), and then use some form of sinc resampling (Lanczos, ...) to scale the video to final resolution. That way you get best of both methods, unfortunately it will also be hardest to implement.

Please take a look here and following posts viewtopic.php?f=117&t=34430&start=25#p355362

Regards.

Locutus73

Locutus73
Captain Atari
Captain Atari
Posts: 170
Joined: Wed Feb 07, 2018 6:13 pm

Re: Poll about prefered scaling quality

Postby Locutus73 » Thu Oct 18, 2018 1:11 pm

ghogan42 wrote:(1) I actually do know what I'm talking about. Not "having a strong opinion about something I haven't tried". I've written several crt style scanline shaders for retroarch and MAME. I've had to worry about proper interpolation and how to balance sharpness vs shimmering. Also I'm a mathematician. So I know that Lanczos scaling is about as good as you're going to get. You could minimize ringing around edges but only if you make it blurrier too...

Can you help us here viewtopic.php?f=117&t=34430&start=75#p355580 ?
The basic idea is finding (if it is possible at all) the right amount of taps and the right edge case coefficients (they can be altered at run time) in order to bastardize a polyphase filter making it behave like:
  1. A Nearest Neighbour filter when we have an integer scaling
  2. A “pixel edge interpolation” filter or whatever we want to call it (please read previous posts in that thread) when we have a non integer scaling
This in order to continue using Quartus VIP scaler and changing its behaviour at runtime without rewriting a scaler from scratch.

Thank you in advance.
Best regards.

Locutus73

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Poll about prefered scaling quality

Postby Sorgelig » Thu Oct 18, 2018 1:16 pm

Integer scaling is possible only one ONE axis while another won't be integer. In analog TV era there was no standard for pixel clock, so different systems have different pixel clocks. So in order to represent it with 4:3 aspect ratio non-integer scaling on other axis should be used.

Locutus73
Captain Atari
Captain Atari
Posts: 170
Joined: Wed Feb 07, 2018 6:13 pm

Re: Poll about prefered scaling quality

Postby Locutus73 » Thu Oct 18, 2018 1:27 pm

Sorgelig wrote:Integer scaling is possible only one ONE axis while another won't be integer. In analog TV era there was no standard for pixel clock, so different systems have different pixel clocks. So in order to represent it with 4:3 aspect ratio non-integer scaling on other axis should be used.

Yeah, I was going to ask in the other thread, can different polyphase taps/coefficient used for horizontal and vertical axis? In the end, the optimal result would be the ability to choose between NN and "pixel edge interpolation" for each axis independently.
In the perfect ideal scenario we would have options for:
  1. HDMI output: we have all we need (honestly more than we need with custom resolutions) in mister.ini.
  2. Width and height (independent) of the actual emulation window output which can be smaller (letterboxing) or bigger (cropping) than the HDMI resolution. A guy on the Classing Gaming Discord is working on this with promising results.
  3. Interpolation on (what I call “pixel edge interpolation”) and off (Nearest Neighbour) independent for horizontal and vertical axis.
Thank you in advance.
Best regards.

Locutus73

hubersn
Atari User
Atari User
Posts: 35
Joined: Fri Sep 11, 2015 8:10 pm

Re: Poll about prefered scaling quality

Postby hubersn » Thu Oct 18, 2018 3:37 pm

vanfanel wrote:In fact, you don't need a MiSTer or a 1360x monitor like mine (1360x768 is a very common resolution anyway in HD-capable HDMI monitors that aren't full-HD),


1360x768 would be extremely uncommon. "HD ready" displays were either 1366x768 (LCD monitors) or 1280x720 (LCD monitors and most projectors).

because this is maths: get any screen with a native 720p resolution and disable bilinear interpolation in, let's say, RetroArch+GenesisPlusGX core. As you disable bilinear interpolation, everything is wrong, from the scenario graphics to the eyes of the main character, wich look wider or thiner depending on the position of the screen. And there is noticeable shimmering in every scroll sequence in the game.


I don't understand why this is related to "math". If the native Genesis resolution can be scaled by Integer means to a true multiple, everything should be fine. As Sorgelig states, if this is not possible, it is better to scale to a higher resolution. Like 1080p, where - until now - nobody seems to have seen a problem.

To me, it looks like the internal scaling of your screen is just completely broken and fails to scale properly from MISTer 720p to 1366x768 (which is obviously not "simple" to scale). Does it have a "true pixel" mode with disabled internal scaling? Have you tried using the MISTer VGA signal - maybe it copes better with analogue input? From what you wrote until now, it is unclear where the problem in your device chain really lies.

Your RetroArch+GenesisPlusGX example really show exactly nothing without diving deep into the details - like "on what platform did you try it" (RPi?). This could make a huge difference. Googling tells me that GenesisPlusGX' maximum width is 720 pixels and its maximum height is 576 pixels. So if your monitor's scaling is as broken as it sounds, it is no wonder that you see such a bad picture quality if you disable interpolation.

And this is what the NN advocates "don't mind", because they prefer to have "razor sharp pixels" in games that were NEVER intended to be unevenly scaled on digital displays, which no matter what you says is going to look very bad.


So far I have read that it scales just fine on displays with 1080p and 2160p. Which seems to be very good and certainly the vast majority of screens out there. Why not target the hardware that was common even 10 years ago? My Toshiba TV, bought in May 2008, is 1920x1080 and can do "true pixel" without scaling or overscan or other strange things. I would expect it to cope just fine. If you want the true retro feeling, surely you just use the analogue VGA output without line doubling and connect it to your CRT?

hubersn


Return to “MiSTer”

Who is online

Users browsing this forum: Indcsion and 7 guests