Simulating CRT Monitors with FFmpeg (Pt. 1: Color CRTs)
int10h.org
int10h.org
https://www.dwitter.net/d/12335
And a more recent one with more interesting motion at faster speed:
https://www.dwitter.net/d/21705
It is interesting how even as an animation it makes it look a lot smoother than the raw upscaled pixels of the same simple graphics.
You could replace 'eval' with 'throw' and see if the output looks like sane JS
The code is mostly arithmetic, so the only thing I can see which could be implementation sensitive is the canvas fillStyle HSL string, which omits commas and spaces since the % postfixes are enough to delimit the saturation and luminance, but obviously this depends on the canvas interface implementation.
If you change the part of your code where you have
hsl(${i*120} 99%${K*99}%
To instead hsl(${i*120} 99% ${K*99}%
(That is, by not omitting the space after 99%)Then it works in the versions of Safari that I tested; Safari 14.0.3 on macOS Big Sur 11.2.2 running on a MacBook Pro M1, and Safari on iOS 14.4 running on an iPhone X.
>DF Direct: CRT Displays - Was LCD A Big Mistake For Gaming?
https://www.youtube.com/watch?v=tvRyVZWuvQ4
>DF Direct! Modern Games Look Amazing On CRT Monitors... Yes, Better than LCD!
You were guaranteed a near-gaussian point in the output, and from a signal-processing POV, this makes filtering and display just really beautiful and easy to do right. For instance, you could do a totally convincing subpixel translation with no visible artifacts.
(and there is absolutely no reason to care, but you are making a comment, so you seem to care a little)
...the tradeoffs are really fascinating. Don't think of it as one being better. It's just a different set of tradeoffs. CRTs are objectively better at some things, and are of course also objectively worse in a lot of obvious ways.
I would say that LPs and tube amps are objectively worse than their modern counterparts in every way. But the tradeoffs involved and the subjective issues are cool and sometimes do make for a better subjective experience in some ways.
LPs are a slightly more interesting discussion IMO. Objectively inferior to Redbook audio by a mile. But, given the 30-40dB noise floor even in a "quiet" room, and the THD added by the loudspeakers, I think their real-world performance competes very very well with digital audio...
While film lets you hide these artifacts with clever tracking and angles, it's very obvious with interactive video games. There are tricks to fix this, but consumer display tech is quite inconsistent.
There also are almost no OLEDs the right size for PC gaming.
Hopefully as VR tech becomes mainstream, display tech can improve up to the 1.5ms mark.
I think the best feature CRTs could provide was the purely analogue display chain in older models. Super fast "response time" and clarity.
Can't comment on the others, though.
In Part 2 (monochrome) the Apple II green monochrome is spot-on accurate and the Amber MDA 80x25 textmode is pretty good except that the background contrast is quite poor. A real amber MDA monitor has much deeper blacks.
I tried to show the range of possibilities in the screenshots/video samples, e.g. higher-res EGA/VGA with no visible scanlines, and some amber monitor shots with deeper blacks, etc. Admittedly, this script is geared more towards simulating lower-resolution CRTs - mostly because my approach entails a large oversampling of the input.
It turns out that real CRTs also have a number of user-adjustable parameters, which of course makes it impossible to define any sort of "canonical" or most-accurate preset. :)
(Like this weird paper-white monochrome CRT that uses P7 phosphor, designed for 350-line MDA but can also handle a greyscale 15.7khz 200-line CGA input... the scanlines are so sharp that it looks 100% fake!)
I'd still like to give it enough flexibility so that a preset can at least be accurate to a particular mode of operation. I actually went down the rabbit hole of looking up a precise persistence curve for the P39 phosphor (as used in the IBM 5151) - found conflicting data, but a friend will be helping out with a video and an ad-hoc program to get some results, so we'll see!
This article breaks it down in wonderful detail: http://renderingpipeline.com/2013/09/measuring-input-latency...
The TL;DR is that on a "modern" stack (USB, display buffering, etc) with a 60hz display you're looking at over 100ms of input latency. You can roughly halve that with a 120hz display.
But it won't ever touch the sub-16ms latency that's possible with a "retro" 8/16-bit console hooked up to a CRT display.
A lot of those games were garbage, but damn... it felt like your brain was wired directly into the machine. A very very cool part of the experience that is being lost to time.
I also remember vector displays first-hand.. those were pretty awesome. You're never going to get a vector graphics experience ever on an LCD because LCDs are rasterized pixels not a drawn line.
No one will ever make a limited run of CRTs or vector monitors ever again, but I wish they would. People would buy them.
No one will ever make a limited run of
CRTs or vector monitors ever again, but
I wish they would. People would buy them.
The prices people are paying for high-quality CRTs today are proof of that. I was lucky enough to get a sweet Sony PVM before the prices really went through the roof.But yeah, they'll never be manufactured again. It would be such an absolutely massive undertaking.
I also remember vector displays first-hand.. those
were pretty awesome. You're never going to get a
vector graphics experience ever on an LCD because
LCDs are rasterized pixels not a drawn line.
Yeah and there's also the temporal aspect -- the "smearing" of ultrabright vector dots, like your bullets in Asteroids.I've seen folks be totally blown away when seeing something like an Asteroids cabinet in person for the first time.
Perhaps in 20 years if they're still around things will be different though. After all CRTs do wear out from use.
Conceptually, emulating a vector display is easy. They are unique but not thaaaat magical.
1. You have a certain amount of bloom
2. You have decay time function
3. You need, perhaps, a surprising amount of dynamic range? If you've seen something like an Asteroids cab in person, the bullets are super bright (with correspondingly larger decay times) relative to everything else
But, how people are interested in implementing that kind of thing and have access to a real vector display in order to study it? I suppose sufficiently good recordings of vector displays might suffice so maybe it's not that dire.
I think if you use a 120Hz monitor on a Linux text console, it would be sub 20ms.
I love that one reply:
"This is incredible. Single user mode
feels like the screen updates BEFORE
pressed the keys, like it is time
travelling. I guess I've used to the
high latency on newer computers."
Do you know of any games/emulators that run in such an environment? (Maybe stuff like RetroPie does by default, I have no idea!)The remainder (a few frames' worth of latency) is from the display itself. There's something like a frame buffer inside the display if I understand correctly although implementations vary widely; some displays are good for gaming and some aren't.
If you have a chance to game with original 8/16-bit hardware with wired controllers on a real CRT it's such a treat. You can really feel the difference.
Example of 10 ms latency on a phone with an OLED display: https://twitter.com/kdrag0n/status/1291213993219039232 (source code: https://github.com/kdrag0n/touchpaint)
Drawing on the screen almost feels natural with such low latency, and it's probably ine of the most latency-sensitive applications for modern computers.
cool!
The other reason is that my shader coding experience is pretty much zero, something I should fix at some point. ;) But if someone more knowledgeable gets inspired by this in the meantime and cooks something up, that'd be cool for sure.
It takes me back to the Amstrad PCW8256 that I used as a kid.
Those double sided CF2 disks were a better disk than either the 5.25" or the 3.5" IMHO.
Not sure how they were better than 3.5" disks at that time (they might have been better than the poor quality once sold towards the end of the Floppy era), but for sure they were much more expensive. I don't miss them one bit.