VOGONS


No CRT Emulation? Why!?

Topic actions

Reply 81 of 162, by avx

User metadata
Rank Newbie
Rank
Newbie

> So I recently tried out the DOSBox core in RetroArch 1.2.2, with the CRT Royale shader - and lo and behold! Convergence errors and bloom in DOSBox

It might now look like your average CRT but I believe there were CRT's that went further, where the effect should be such that eg. the text is fuzzy enough to a degree where the center of a pixel has higher contrast than the edges, but if there is a neighboring (even diagonally) pixel of similar intensity and color, it somehow bleeds a bit filling that void (but not overtly, just enough to fool you from normal viewing distance that there might be something where there isn't if you go closer). eg in that text "disabled", you can see in the "d" letter there is clear rectangular look to it - a vertical and horizontal line (vertical starting at row 3). Similarly in "x" in "Text", the x looks as if there's stair steps. Such should not be visible due to the round pixels bleeding into each other.

Now granted, it's possible majority of old CRT probably were not like this, as people generally wanted sharper image and that's where things evolved. Also the evidence for the above being true, well I can't vouch for it, because if someone takes a photo of a CRT, we don't know if the camera focus was matched to replicate how the CRT looked to your eyes when they were focused at typical viewing distance.

The supportive theory behind this is that small vga crt had larger pixel pitch and some had different shape (or even arrangement) of the dots being illuminated (eg the rgb not in a rectangular looking row) . When LCD pixel is magnified, they typically are rectangular. (Samsung pentile might be recent exception here atleast for the dot arrangement)

The implication is that developing the CRT emulation to look convincing is a bit like tuning some kind of musical instrument by ear with help of a reference (either ones memory of how it should look like or a CRT that actually doesn't have pixelated look when viewed from regular distance). To make that possible there should be easy way to tweak all the parameters of the "emulation" on the fly while running some test image that one either has a good idea how it should look like or can do side by side comparison to suitable CRT.

I might've posted this before here but here's an example of the usefulness of easy tweaking: https://www.youtube.com/watch?v=d1qEP2vMe-I (micro64 tv emulation, plenty of sliders with immediately visible effect)

Reply 82 of 162, by avx

User metadata
Rank Newbie
Rank
Newbie

Some interesting info here...
https://www.youtube.com/watch?v=W86eYfO2nac&t=300s

However he makes some statements I don't quite agree with. Like that all PC CRT are blocky with 320x200. In the end he does get into the dot pitch point (suggesting that perhaps his CRT is blocky due to that). There has been PC VGA monitors with various dot pitch from my research - it may well be that *most* of the 14" PC VGA CRT do look blocky indeed because that probably was preferable for non-gaming applications but photos from CRT in old mags that display games suggest not all had blocky graphics.

Beyond that, there's also the deep colors and contrast etc that make the games just look much better- similarly to the effect you see when going to a shop - the OLED screens stand out if the room is dark and the material is dark, so high DPI OLED and suitably tweaked CRT emulation should be able to reproduce that non-aliased look even for 320x200.

Reply 83 of 162, by Mr_Blastman

User metadata
Rank Member
Rank
Member
avx wrote:

Here's a pretty up close video of Tandy CRT:

https://www.youtube.com/watch?v=hSaAZAYh1UI

Pay attention to lack of any rectangular pixels. There's a lot of fake youtube videos shot in dosbox, beware..

That's a CM-8 color monitor which was less common at the time, had a sharper picture, anti-glare coating on the screen and flatter color reproduction. The CM-5 rgb monitor was superior for games at the time due to the wider dot pitch (I think it was .66!), color bleed, phosphor glow and wait for it... phosphor ghosting!

Thexder, as I posted in other threads on here, looks nothing on emulation or even late 80s era VGA monitors like it did on the CM-5. It looks awesome on that old RGB monitor. Words can't describe how good it looks. It looks... magical. Even Rogue looks great. It takes the DOS ASCII set and adds charm to it. In Bard's Tale, when you win a battle and are shown the treasure, it really seems to sparkle and looks like true gold.

Reply 84 of 162, by leileilol

User metadata
Rank l33t++
Rank
l33t++

Uh...one time I tried that old cgwg shader with some efx/sweetfx with PCem, and tried to get it to work as close to an IBM XT I remember. Had to manually force the shader to use 656x208 and edit the D3D output code to nearest filter.

Doesn't look authentic enough though. Needs more blue pollution.

Attachments

  • fakepcemxt.png
    Filename
    fakepcemxt.png
    File size
    903.67 KiB
    Views
    4620 views
    File license
    Fair use/fair dealing exception

apsosig.png
long live PCem

Reply 86 of 162, by Azarien

User metadata
Rank Oldbie
Rank
Oldbie

Doesn't look authentic enough though.

Looks like very *bad* CRT.
A *good* CRT may be very hard to emulate, because the effect is much more subtle.
And realistic 60Hz flicker may be impossible to do on LCD.

Reply 89 of 162, by Mr_Blastman

User metadata
Rank Member
Rank
Member
leileilol wrote:

I'm certain there's people who want that high frequency hum too

My Tandy CM-5 also starts to smell after it warms up. After a half hour of Rogue it has a distinct smell. I almost forgot about that "feature" of those old monitors.

Your picture of the IBM monitor emulation isn't bad.

dosbox.exe_DX9_20150424_024327_zpsslfkrg8c.png

dosbox.exe_DX9_20140623_014634_zpsdyjad28e.png

The tricky part is certain eras had monitors with particular characteristics. The mid to late 80s monitors I find next to impossible to emulate (so far) in Dosbox. I'm still trying! The shots above approximate a early 90s VGA CRT. Note the monitor glow. It is very subtle around the edges.

Also, the 90s era CRTs didn't have noticeable scanlines. I've got a 93/94 VGA monitor and there are none. I wish I had one from 89. My Tandy CM-5 has unique pixelation

Unfortunately Daum is only DX9 which means I can't use the DX11 features of Sweetfx which would negate color bleed from dark sources (i.e. black). In DX 9 all colors bleed in the form of glow. We've come a long way though!

Multipass shaders like I have in Retroarch can take it further...

RetroArch-0427-150325_zpsampuqiem.png

But the CM-5 has a unique shadow mask. Here's a shot from Mame showing something close... You must fullscreen @ 1080p to see it clearly.

Mameui64%202016-02-09%2011-04-41-11_zpszulu6ymt.png

But even then, it isn't super bright with all the color bleed and glow that the real monitor has. Here's the real monitor. I played with the exposure times but still couldn't capture the true brightness and color of the screen--cameras and refresh rate, etc. But you can at least pick out some of the finer details minus the glow and intensity.

The first one has no exposure settings. The colors are too washed out, however--but you can see intensified glow and ghosting.

P1010053_zpst5aqclq4.jpg

The rest use 1/30 exposure.

P1010061_zps6le4vdma.jpg

P1010062_zpsio5bxmfk.jpg

Here you can see ghosting... If you had superman eyes. It looks different in practice but the camera caught the delay...

P1010063_zpszkdiyae3.jpg

And here's one that is brighter.

P1010064_zpsprzkbiul.jpg

None of these have been altered. If you zoom in at full resolution 2592x1944 you can see something unique about CRT monitors. While Thexder was a 16-color game, you see color gradation between colors and borders. The RGB CRT gave the games pseudo anti-aliasing and color boost, dramatically increasing the visible palette. This part is hard to emulate without multipass and phosphor bleed.
I'm a mad hermit. My quest for perfect emulation is endless.

Reply 90 of 162, by Mr_Blastman

User metadata
Rank Member
Rank
Member
leileilol wrote:

Uh...one time I tried that old cgwg shader with some efx/sweetfx with PCem, and tried to get it to work as close to an IBM XT I remember. Had to manually force the shader to use 656x208 and edit the D3D output code to nearest filter.

Doesn't look authentic enough though. Needs more blue pollution.

Btw, how'd you get the cgwg shader etc. to work with PCem?

Reply 91 of 162, by Azarien

User metadata
Rank Oldbie
Rank
Oldbie
leileilol wrote:

I'm certain there's people who want that high frequency hum too

And that burning sensation in one's face after long hours of radiation exposure...
You won't get that from fancy shaders 😉

Reply 92 of 162, by Mr_Blastman

User metadata
Rank Member
Rank
Member

I have done something amazing I think. This is the closest I've ever come to a Tandy CM-5 RGB monitor with dosbox! There's some more tweaking left to do but I'm close, real close. The hardest problem for the longest time was the pixel grain. In my screenshots in a post above of a real Tandy monitor, you can see it. I never could get this in Dosbox... until now. Granted, the above screenshots aren't representative at all how the color saturation and brightness looks on a real CM-5, as I can't figure out how to get my camera to take a proper picture of it. Regardless, I'm close, real close. It looks nifty in non-RGB era games, too.

It is important to note that monitors did vary by era in a short period of time. A 1988 VGA monitor looked quite different from a 1993 one due to dot pitch, electron gun quality, phosphors, shadow mask and other bits inside of them. Likewise, a 1986 RGB monitor looked significantly different from a VGA monitor of any era, and did amazing things to 16-color graphics you couldn't achieve on a regular VGA monitor due to doublescan and general improvements to rendering accuracy. The earlier monitors had what we refer as today as "post processing" built into their hardware, even if it wasn't the manufacturer's intention. That's why old screens dramatically enhance old games.

So, this is where I'm at now. The second biggest problem was making the image bright enough, but I figure out how to fix that! I can now make eye-bleedingly bright graphics on a LCD monitor in dosbox. What do I need to figure out next? Ghosting. I have no idea how to achieve this, but... those older RGB monitors had tons of ghosting. That's the next thing I'm going after once I perfect the color balance. My only sadness is there isn't a dosbox capable of Direct X 11 yet. If there was, my modified SweetFX with gaussian transforms would allow me to eliminate darker color bleed.

First screenshot is with Amp signal overdrive set to 5.25 in SweetFX 2.0 preview 8 under the Pixelshader
// -- Amp signal --
#define PixelArtCRT_overdrive 5.25 //

dosbox%202016-10-31%2011-44-27_zpsmdyyzplt.png

Following three are with Amp signal set to 3.25:

dosbox%202016-10-31%2012-08-53_zpskahu2ted.png

dosbox%202016-10-31%2012-09-53_zps6mpp1euk.png

dosbox%202016-10-31%2012-07-06_zps9njsvb7u.png

How do I do this?

SVN Daum + CRT.D3D.br.fx

SweetFX + Reshade, 2.0 preview 8

Tweaks to CRT.D3D.br.fx
Modified SweetFX to re-include the old Gaussian filter for monitor glow, plus tons of tweaks to the configs, and using the Pixel Art CRT shader but NOT using the Advanced CRT shader (THIS IS IMPORTANT because Advanced CRT adds tons of shadow mask wire lines to the image)

I should probably share my settings sometime. I'm willing to bet some other folks here would love to give them a try, so... I've included an attachment. 😀 They're just the config files. The gaussian header file must go in the Sweetfx subfolder from the Dosbox root dir. The shader file goes in the obvious daum place, and the conf goes in the dosbox root directory. I would attach the particular version of reshade I'm using but I'm not sure we're allowed to do that here?

Enjoy.

If anyone tweaks it more than I have and thinks they have improved, please share. 😉

Filename
CRTgoodiesforvogons.zip
File size
23.43 KiB
Downloads
196 downloads
File comment
CRT Sweetfx/Reshade + daum shader + config settings for Dosbox
File license
Fair use/fair dealing exception

Reply 93 of 162, by Kisai

User metadata
Rank Member
Rank
Member
Mr_Blastman wrote:

I have done something amazing I think. This is the closest I've ever come to a Tandy CM-5 RGB monitor with dosbox!

I think it's interesting that you're going through the effort to do this, but it's going to have the unfortunate problem of not being portable.

My personal opinion on CRT emulation is "don't bother", aside from correctly trying to emulate CGA, you would never actually want to play a game with these filters on for the same reason we were always told not to sit so close to the tv/computer screen, it gives you eyestrain, because it's not quite in focus.

They are interesting from the point of view of trying to illustrate what emulation doesn't actually emulate, but it always comes off as like "look at this wonderful VHS tape, even though I have it on DVD", such comparisons ignore the entire mastering process which comes out of much higher resolution sources or digital sources.

The thing I need to point out is that the original monitors dot pitch and shadow mask reflect the size of the monitor. So those old monitors were all 12-14", if you were to play a 640x480 game on a 21" CRT it looks more like a LCD, yet, if you were to use "TV out" that was available on many late 1990's PCI video cards to your 21"+ NTSC TV you would again see other problems like overscan and 640x480 was often unreadable on a TV (because you really get 480i and NTSC colorspace, not RGB)

So your experience with your monitor might not reflect other peoples experience with the CRT, and no two CRT's are identical due to age.

My suggestion here, at least if you want to try make it portable, is to see if you can port it to the OpenGL shaders. SweetFX won't be available on MacOSX or Linux. I often see SweetFX used on games to "make them look better" but most applications of it are way to subjective, and I find most of the time it makes images too bright or too dark.

Personally I'd prefer that the shaders be entirely self-contained shader programs so that they are portable.

avx wrote:

The supportive theory behind this is that small vga crt had larger pixel pitch and some had different shape (or even arrangement) of the dots being illuminated (eg the rgb not in a rectangular looking row) . When LCD pixel is magnified, they typically are rectangular. (Samsung pentile might be recent exception here atleast for the dot arrangement)

IIRC the Tandy 1000 monitor we had might have been a Trinitron style (vertical stripes) which were considered superior. Then again we had two Sony TV's at the time and I might be mis-remembering those. Someone with the original Tandy monitors would need to take a magnifying glass and look.

This comes from a usernet posting https://groups.google.com/forum/#!topic/comp. … ndy/1EasA7Lb7eg :

CM-11 (25-1024/A/C) Specifications Faxback Doc. # 6012 […]
Show full quote

CM-11 (25-1024/A/C) Specifications Faxback Doc. # 6012

CRT..................13" diagonal, 90' deflection, high contrast,
non-glare
picture tube, 0.42mm stripe pitch, P22 Phosphor

Input Signal.........Red, Green, Blue (RGB) video and intensity, vertical
and horizontal synchronization

Input Level..........Video TTL-positive, intensity TTL-positive, vertical
and horizontal synchronization, TTL-positive

Input Connector...........................9-pin Sub-D connector with cable

Scanning Frequency:
Horizontal.........................................15.701 Hz +/- 500 Hz
Vertical...............................................60 Hz +/- 1.0 Hz

Display Size............................................9 27/32 x 7 15/32"
Resolution............................................640 Dots x 225 Lines
Character Number..................Approx. 2000 (25 lines of 80 characters)
Cabinet Dimensions.............13 11/16 x 12 17/32 x 15 1/8 inches (WxHxD)
Weight.......................................................23 lbs. 2 oz.
Power Cord...................................................Approx. 6 ft.
Power Supply................................................120 VAC, 60 Hz
AC Input Current......................................................0.8A

The CM-11 has many advantages over other color monitors. These include:

* Thirteen-inch color display providing eye-pleasing graphics * Adjustable
picture controls that tailor brightness and contrast to suit
environmental lighting
* Unique, selective light transmission properties which reduce the effects

of ambient light while maintaining true color purity, even under harsh
lighting conditions
* Sharp, "flicker-free" image provided by non-interlaced circuitry * RGB
direct-drive signal system that provides 640 by 225 display for crisp
characters and vivid color graphics

Take note of "stripe pitch" and P22 Phosphor.

Like, it should be noted that a new CRT is much brighter than an old one. Monitors often had analog controls for the brightness and contrast, just like a television.

Reply 94 of 162, by Mr_Blastman

User metadata
Rank Member
Rank
Member

I have advanced to the next level. I have done the impossible. I have managed to run dosbox with not only a CRT bezel, but multipass shaders inside of Retroarch with full access to the keyboard (minus the escape key but I can probably fix that).

The only thing not working in libretro Dosbox is midi (no MT-32 or SC-55 🙁 ), at least, I haven't figured out how to make them working yet. Regardless, Dosbox with bezel support is a wonderful thing to behold. And I will demonstrate it with none other than Inner Worlds, one of the heavier games inside of Dosbox:

https://www.youtube.com/watch?v=FvRmog-NUVM

To make this possible, I had to modify a bezel I found in a CRT shader package--the .png file needed a .cfg file made in the /overlays subfolder, which was easy enough to do after I downloaded some other overlays and mimicked them. The hardest part was setting the x/y values inside the Retroarch.cfg so the image would center within the bezel and still allow it to display fullscreen. Once I got over this hurdle, I needed good shaders... no, great shaders. Because, why not?

This shader pack is AWESOME:
https://forums.libretro.com/t/analog-shader-p … -3-is-here/5493

The shader I settled upon was Halation Soft. The VGA shader is pretty good, too, with subtle monitor glow and all the other bits that made VGA monitors look like they did, at least, as far as my eyes are concerned. But soft halation is sexy, in a crappy television kind of way. My second favorite is the 80s Arcade CRT shader which, well, is a sight to behold, especially if you remember gaming in arcades back in the day. It is best used with older games, of course, but works just fine in Dosbox--and looks pretty nice with stuff like Thexder.

Anyways, the trick is editing out all the keybinds inside the Retroarch.cfg file so the keyboard is accessible. The second trick is to realize the dosbox.cfg is basically useless, and instead, you must change the cycles and video modes inside the game submenu options when dosbox is running. I never realized you can do this, and it is what prevented me for the longest time from getting stuff like Wing Commander running.

Oh, one other problem--not sure how to get joystick working in Retroarch dosbox. Anyways, I can't complain, bezels + CRT emulation in Dosbox is awesome.

Reply 95 of 162, by Mr_Blastman

User metadata
Rank Member
Rank
Member

My quest continues, and now I have hit power level 9000:

https://www.youtube.com/watch?v=D3AE2twxgEg

Details to follow. Needless to say, the process was a bit complex to decipher, but worth the effort so far. Still, not perfect, but getting closer.

Reply 96 of 162, by appiah4

User metadata
Rank l33t++
Rank
l33t++

CRT is a very wide range of things. My first CRT monitor was a Commodore 1084S and it was nothing like my next one, a B/W monitor for my 8086 PC Compatible. My first 14" VGA montir was also nothing like the first two either. The question is, what will you target? Flat CRTs or curved ones? A Sony Trinitron looks nothing like a Philips Brilliance - even for more modern CRTs, the appearance varies greatly.

Retronautics: A digital gallery of my retro computers, hardware and projects.

Reply 97 of 162, by Mr_Blastman

User metadata
Rank Member
Rank
Member

Depends on my mood the day that I game. You're right, monitors varied widely. When I play mid to late 80s games, I expect them to be played on a Tandy RGB monitor, which had a vastly different picture than a early 90s VGA monitor, and that early 90s VGA monitor looked radically different than the late 80s VGA monitor, and that looked different than the IBM PS/2 MCGA screen(which had an awesome "crystallized" effect).

The shaders aren't mine, but I tweak them, and are a part of the Analog Shader Pack version 3, by solid12345. Amazing multipass shaders, they require Retroarch. I can do what I've accomplished here outside of Retroarch, using the latest Reshade plus the Retroarch shader .fx ports, but there's severe performance issues with SVN-Daum and ridiculous color banding outside the frame of the game image. Retroarch overcomes this limitation.

The downside with Retroarch is they haven't fixed the command line mixer settings yet, so I can independently adjust left and right volume levels for stuff like SB DAC audio, FM, PC speaker, etc., so in games such as Silpheed which use speaker for effects and Roland for music, or the PS/1 version which uses SB for effects, Roland for music, to prevent the effects from drowning out the music. I'd fix this if I knew how, but I'm not a coder.

I'm trying to figure out how I might distribute this in a zip file so someone who has Retroarch can easily install it, but part of the configuration process requires you to edit out all the hotkeys from the keyboard that Retroarch uses, and change around a couple others so you can use the keyboard properly in DOS. Easy to do, but for someone who's not familiar with the libretro setup, might be overwhelmed.

Reply 98 of 162, by leileilol

User metadata
Rank l33t++
Rank
l33t++

You can also use Retroarch GLSL shaders and presets in PCem starting from v13 😀
I've tried to hack some of the RA GLSL shaders to adapt better for the higher guest resolutions and for 1080p with presets roughly mimicing a few CRTs.
no overlays though. as an artist I feel an overlay is too arcane of a concept to this and should rather be a handmade 3d model with the screen texture on a surface with shaders reflecting the image
we still don't have noises for floppies and hard drives and processed pc speaker EFX etc. for extra realism

apsosig.png
long live PCem

Reply 99 of 162, by Mr_Blastman

User metadata
Rank Member
Rank
Member

J. Kyle Pittman has done some nifty work with his CRT emulator that has a 3D model border with the reflections you speak of:

https://piratehearts.itch.io/supercrt

Neat tool. He incorporates the emulation in all the games he has made. The big downside to the tool though is you can't maximize the window to fullscreen due to how it captures the input space for processing and display in the output window. Maybe it works on a multi-monitor setup? I'm not sure. Still, what you speak of, 3d models of the PC and desk with reflections has long been a dream of mine, too.