Emulator with a "TV filter"?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Emulator with a "TV filter"?
by on (#218836)
Everyone who has played on both emulator and on real NES probably has noticed how different they look visually. NES has some blurry edges, slightly inconsistent color (some colors changing slightly), contrast issues (might be the TV as well, but not sure), a bit of motion blur, scanlines not perfectly aligned and so on. Does any emulator have a filter that would at least try to make it look like what it would look like on NES?
Re: Emulator with a "TV filter"?
by on (#218837)
I use nintedulator if i want to get close to something like an NTSC experience (or what i imagine it to be). For PAL, i just use my old unit because nothing i've tried emulator-wise looks quite like it. One thing you don't get in emulation so far is how different the APU + audio out actually sounds.

btw is there really motion blur? that's not something i've noticed.
Re: Emulator with a "TV filter"?
by on (#218838)
Nestopia has had an NTSC filter for ages, based on accurately modelling the NTSC signal generation and decoding process.

So called "CRT filters" on the other hand are usually just toys, rarely-ever accurate to the characteristics of any real-life CRT, and so best avoided.
Re: Emulator with a "TV filter"?
by on (#218839)
SusiKette wrote:
NES has some blurry edges
"NTSC filters" are available in most modern emulators. As FrankenGraphics said, the artifacts look conspicuously different from PAL artifacts, but I think there was recent work in writing a PAL artifact generator in ... FCEUX?

Quote:
slightly inconsistent color (some colors changing slightly)
Do you mean on horizontal edges? Or vertical edges?

Horizontal edges should be addressed by using an NTSC filter (or where-ever that PAL filter got off to)

For vertical edges, the NES's output is really lackluster, and would cause dramatic Hanover bars on PAL. A single horizontal scanline of color will shimmer up to ±15° hue if it's moved up and down one scanline at a time.

Quote:
contrast issues (might be the TV as well, but not sure)
Probably the TV

Quote:
a bit of motion blur
The phosphors used in CRT TVs since 1970 or so have a halflife somewhere around 4.5ms. While there is a little bit a motion blur, it should only be visible in the pixels that were anything but black and then are subsequently black.

Quote:
scanlines not perfectly aligned
That sounds like the TV.
Re: Emulator with a "TV filter"?
by on (#218841)
FCEUX has an NTSC filter option, and it looks quite good. I was just commenting on rainwarrior's most recent Twitch stream about NTSC filters. "Running on emulator or actual hardware? Hard to tell, looks pretty real". <brief chat on stream about it; he was using FCEUX>
Re: Emulator with a "TV filter"?
by on (#218845)
Many emulators have an NTSC filter that reproduces how the NES' generated signal looks very well. FCEUX, Nestopia, Nintendulator DX, Bizhawk, PuNES, Mesen, etc. it's very commonly available.

Blargg wrote a version of it a while ago that has more or less become the reference implementation for it. A lot of the emulators that have it are directly using this library:
http://slack.net/~ant/libs/ntsc.html

Bisqwit wrote another version that was contributed to the wiki. Blargg's version was written for efficiency, but Bisqwit's is instead written to be a simple expression of the process that's easier to follow:
http://wiki.nesdev.com/w/index.php/NTSC_video#Emulating_in_C.2B.2B_code


PAL signal generation, on the other hand, is not as widely implemented or documented in a very palatable form yet. There was a good thread here a while back:
viewtopic.php?f=3&t=12788


Anyhow, generating that signal is the first step of the process, and probably the most important one that has the greatest and most consistent impact on the image. The second step is how that signal appears on a television, which unfortunately varies a great deal from TV to TV. It's hard to give much reasonable advice about this.

CRTs which display interlaced alternating lines (480i at 30hz) when given an NES signal (240p at 60hz) end up skipping every second line, but having double brightness and double the framerate. This is sometimes simulated with an option that gets called "scanlines", but it's kind of impossible to simulate the appropriate brightness, and the actual spacing of the gap has hugely variable; some TVs have significant vertical blurring that can close that gap. (When simulating scanlines, it also becomes much more difficult to scale the image cleanly without introducing noticeable aliasing from the scanlines.)

FrankenGraphics wrote:
btw is there really motion blur? that's not something i've noticed.

The brightness of the excited phosphor on the screen does not instantaneously change. There's an exponential curve where it falls off after being hit by the beam. This can create a fade/ghosting effect. Again very hard to simulate on anything but a CRT, mostly because it's very subtle and involves a very high dynamic range of contrast. It's hard to see without small bright objects moving across a mostly black CRT screen in a dark room, but it is real. Old thread about it here: https://forums.nesdev.com/viewtopic.php?f=3&t=10171

Other defects of the CRT image that you might simulate include things like: horizontal blur (filtering/bandwidth issues), variable colour controls (hue, tint, brightness, contrast), poorly adjusted deflection (e.g. barrel distortion), the 15kHz whine that these TVs produce, various chromatic aberrations, vertical/horizontal hold failures, other common modes of malfunction, etc. but this is all up to taste, mostly can't really be simulated on an LCD very faithfully, and there's no definitive version of how this should look.

Most "CRT" simulations end up really over-emphasizing some narrow aspect of a real CRT effect and ignoring a lot of others.


Edit: as usual here I'm a little bit redundant with some above posts that happened while I was typing.
Re: Emulator with a "TV filter"?
by on (#218860)
FrankenGraphics wrote:
I use nintedulator if i want to get close to something like an NTSC experience

But... Nintendulator doesn't have any sort of video filtering... Last time I checked, it just used bilinear filtering if the window was scaled up, and even used square pixels.

I can't use emulators without using NTSC filters anymore, I really like the way they look.
Re: Emulator with a "TV filter"?
by on (#218861)
Everything that runs on RetroArch can use a shader that tries to simulate a TV.
Re: Emulator with a "TV filter"?
by on (#218870)
tokumaru wrote:
Nintendulator doesn't have any sort of video filtering...

thefox made a fork called Nintendulator DX that has an NTSC filtering option.
Re: Emulator with a "TV filter"?
by on (#218878)
rainwarrior wrote:
tokumaru wrote:
Nintendulator doesn't have any sort of video filtering...

thefox made a fork called Nintendulator DX that has an NTSC filtering option.

I've started to call it NDX myself in a (vain?) attempt to avoid confusion.
Re: Emulator with a "TV filter"?
by on (#218882)
FrankenGraphics wrote:
btw is there really motion blur? that's not something i've noticed.


Not necessarily blur. I just didn't have a better name for it and that's what is looks at first. Some things that change every other frame such as bomb explosion in RECCA and air ship disappearing (at the very end) in SMB3 look like the current and previous frames are blurring together a bit. When I look closely it looks something like this. I'm not sure though how it should look if the pixels weren't scaled up on a TV, but I guess it could be impossible to know.

Attachment:
nes-blur.png
nes-blur.png [ 4.63 KiB | Viewed 4479 times ]


lidnariq wrote:
Do you mean on horizontal edges? Or vertical edges?


I mean that sometimes when I play SMB the light blue background color changes in tone slightly. As far as I'm concerned this is not something that should happen within the game.

lidnariq wrote:
Probably the TV


It's kinda annoying actually. In SMB at the "lives left" screen Mario is super bright like he is giving off light or something.
Re: Emulator with a "TV filter"?
by on (#218883)
SusiKette wrote:
Not necessarily blur. I just didn't have a better name for it and that's what is looks at first. Some things that change every other frame such as bomb explosion in RECCA and air ship disappearing (at the very end) in SMB3 look like the current and previous frames are blurring together a bit. When I look closely it looks something like this. I'm not sure though how it should look if the pixels weren't scaled up on a TV, but I guess it could be impossible to know.
Attachment:
The attachment nes-blur.png is no longer available

You might be describing interlacing? On most LCD TVs, the composite NES' 60fps 240p signal will get interleaved into a 30fps 480i image, so half the framerate with every second line from one frame or the other. This wouldn't normally have happened on a CRT, though, but you'd still get a transparency effect because the image persists in your vision anyway.

Here's an image I made a while ago, comparing a 480i capture from my Famicom with its de-interlaced 240p counterpart. (Click on the image, the GIF preview resizer on this forum is busted.)
Attachment:
gimmick_deinterlace.gif
gimmick_deinterlace.gif [ 119.18 KiB | Viewed 4477 times ]
Re: Emulator with a "TV filter"?
by on (#218899)
NewRisingSun wrote:
Nestopia has had an NTSC filter for ages, based on accurately modelling the NTSC signal generation and decoding process.

So called "CRT filters" on the other hand are usually just toys, rarely-ever accurate to the characteristics of any real-life CRT, and so best avoided.


Nestopia's filters is definitely my favourite. It has good looking scanlines, and an adjustable filter that allows you to recreate something looking like a good RGB signal.

I'm not a fan of filters that go out of their way to simulate horrible blurry composite video, which is just a side effect of all the interference in the video signal, and not really optimal. But a sensible RGB filter that gives a similar effect without going out of its way to simulate CRT oddities like curvature, bad geometry, overscan etc. has the intended effect of making games appear like they are created to look without just looking bad for the sake of looking bad.