DOS Games Message Board
DOS Games Discussion
A message board to talk about DOS games, get help, and find old games.
Do NOT post warez or abandonware requests please
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


CRT screen imitation in DOSBox

 
Post new topic   Reply to topic    DOS Games Discussion Forum Index -> General Gaming
Author Message
MrFlibble
Demoniac Demo maniac
Demoniac Demo maniac


Offline
Joined: 05 Dec 2010
Posts: 2269

PostPosted: Sat Apr 05, 2014 11:25 am     Post subject: CRT screen imitation in DOSBox Reply with quote

I was playing around with pixel shaders that are included with DOSBox SVN Daum when I realized that several of them alter the DOSBox output to make it look like an image on an authentic CRT screen. One of them even goes as far as to recreate the "fishbowl" distortion of an actual monitor:




Another shader creates a less distorted (but still not completely rectangular) image:


In my opinion, this looks pretty awesome (especially the fishbowl effect one). To configure DOSBox SVN Daum to use this shader, you need to make the following changes in dosbox.conf:
Code:
[sdl]
output=direct3d
pixelshader=CRT-geom-curved.fx

[render]
aspect=true
scaler=hardware2x

The CRT-geom-curved.fx shader will create the fishbowl effect. You can use are CRT.D3D.fx instead to get a less prominent surface distortion, and CRT.D3D.br.fx for a brighter version of CRT.D3D.fx.

This works both in the windowed and fullscreen modes.

You can also get higher resolution images by using hardware3x, hardware4x and hardware5x instead of hardware2x:


Last edited by MrFlibble on Mon Apr 07, 2014 9:16 am; edited 1 time in total
Back to top
dosraider
Admin
Admin


Offline
Joined: 15 Mar 2005
Posts: 9259
Location: ROTFLMAO in Belgium.

PostPosted: Sat Apr 05, 2014 2:01 pm     Post subject: Reply with quote

....interesting screen setup.
For old times sake you could say. Laughing

if it looks better in a fishbowl ...... dunno, not really I must say.
Back to top
Quadko
Darklander
Darklander


Offline
Joined: 24 Jun 2011
Posts: 1946

PostPosted: Sat Apr 05, 2014 3:04 pm     Post subject: Reply with quote

Sweet, that's fun. It's nice to see DosBox getting more and more of the advanced features that emulators of "simpler" systems have achieved.
Back to top
MrFlibble
Demoniac Demo maniac
Demoniac Demo maniac


Offline
Joined: 05 Dec 2010
Posts: 2269

PostPosted: Sun Apr 06, 2014 11:07 am     Post subject: Reply with quote

Quadko wrote:
It's nice to see DosBox getting more and more of the advanced features that emulators of "simpler" systems have achieved.

Apparently lots of things can be accomplished with shaders (for comparison, the built-in DOSBox scalers that add scanlines look much worse than the shader CRT imitation). There's another one that can turn VGA output into EGA for example.
Back to top
MrFlibble
Demoniac Demo maniac
Demoniac Demo maniac


Offline
Joined: 05 Dec 2010
Posts: 2269

PostPosted: Mon Apr 07, 2014 9:26 am     Post subject: Reply with quote

I Googled information on the first shader (CRT-Geom), and it turns out that it can be customized to adjust screen curvature, gamma correction etc. by editing the shader file. Apparently this is initially a shader that was written for console emulators (and thus it supposedly imitates a CRT TV screen), and then ported to work with DOSBox.

A very detailed description of how to customize the console emulator version can be found here. It is possible to reduce the curvature of the screen, or disable it entirely if desired.

Without curvature emulation, screen output looks like this:

This is enabled by commenting out (with //) the following line in CRT-geom-curved.fx:
Code:
  // Enable screen curvature.
  //#define CURVATURE

And here's what the screen looks like with the shader set to imitate a less curved screen, with smaller rounded corners:

To get this, just change the lines:
Code:
  // aspect ratio
  float2 aspect = { 0.5, 0.5 };

and
Code:
  // size of curved corners
  float cornersize = 0.02;
Back to top
MrFlibble
Demoniac Demo maniac
Demoniac Demo maniac


Offline
Joined: 05 Dec 2010
Posts: 2269

PostPosted: Mon Apr 28, 2014 5:14 am     Post subject: Reply with quote

I've asked the experts at VOGONS and it turns out that I made the mistake of taking screenshots in windowed mode, which does not do justice to the shaders' actual capabilities. leilei also suggested to use CRT.D3D.br.fx as the preferred shader.

Here's a comparison of all three shaders in fullscreen mode (1600x900): CRT-geom.curved.fx, CRT.D3D.fx, CRT.D3D.br.fx.
Back to top
dosraider
Admin
Admin


Offline
Joined: 15 Mar 2005
Posts: 9259
Location: ROTFLMAO in Belgium.

PostPosted: Mon Apr 28, 2014 10:22 am     Post subject: Reply with quote

MrFlibble wrote:
.... CRT.D3D.br.fx.

Looks indeed pretty good I must say. I could be looking at one of my old CRTs .... Happy

minus the heat of the ol'tubes and minus radiation ..... Laughing
Back to top
MrFlibble
Demoniac Demo maniac
Demoniac Demo maniac


Offline
Joined: 05 Dec 2010
Posts: 2269

PostPosted: Mon Apr 28, 2014 12:23 pm     Post subject: Reply with quote

dosraider wrote:
I could be looking at one of my old CRTs .... Happy

minus the heat of the ol'tubes and minus radiation ..... Laughing

Shit-Eating Grin

In the meantime, the VOGONS guys have posted some photos of what actual CRT TVs and monitors look like.

I guess I'll have to read up some stuff on how CRT TV screens and CRT computer monitors work, like this:
http://www.ehow.com/info_7783410_do-differ-regular-crt-tubes.html
http://www.scholarshipsinindia.com/answer/subtle_difference_between_computer_monitor_and_colour_television.html
http://www.hitequest.com/Kiss/TV.htm
Back to top
MrFlibble
Demoniac Demo maniac
Demoniac Demo maniac


Offline
Joined: 05 Dec 2010
Posts: 2269

PostPosted: Tue Apr 29, 2014 9:20 am     Post subject: Reply with quote

Apparently the normal2x scaler produces a better result compared to hardware2x. Here's a comparison of all three CRT imitation shaders:

CRT-geom-curved (hardware2x)
CRT-geom-curved (normal2x)
CRT.D3D (hardware2x)
CRT.D3D (normal2x)
CRT.D3D.br (hardware2x)
CRT.D3D.br (normal2x)
Back to top
dosraider
Admin
Admin


Offline
Joined: 15 Mar 2005
Posts: 9259
Location: ROTFLMAO in Belgium.

PostPosted: Tue Apr 29, 2014 10:48 am     Post subject: Reply with quote

You're really bitten by this, ain't you?

Indeed, normal2x scaler looks slightly better.

One point however, whilst it's true that all older CRTs had a fishbowl effect, some more than others, the latter CRTs (and not the cheapest of them meheh) had an almost flat screen, and the latest ones ( again not the cheapest ones ...) had even a perfect flat tube surface.
Same goes for TV sets. I remember the trinitron tubes, some could (*almost*) compete with PC LCD monitors, certainly the latter 27" tubes. (and weighted a 100 kgs lmao)
Just to say that talking about CRTs and fishbowl effect isn't always 100% correct .....
Back to top
MrFlibble
Demoniac Demo maniac
Demoniac Demo maniac


Offline
Joined: 05 Dec 2010
Posts: 2269

PostPosted: Wed Apr 30, 2014 5:28 am     Post subject: Reply with quote

I used to have a 17" almost-flat CRT monitor in the late 90s/early 2000s. The thing was huge. Also when it got worn a bit it would sometimes get noticeable framerate drops after screen resolution changes (e.g. when you quit a game that runs in a lower resolution back to the desktop).

While not 100% accurate, these shaders are certainly a nice retro gimmick anyway Happy

BTW, it is my understanding that normal2x provides a more accurate result for VGA (leilei says EGA and CGA should use hardware2x anyway) because VGA doubles the number of lines:
Quote:
320x200 @ 70 Hz, the most common mode for VGA-era PC games, uses exactly the same timings as the 640x400 mode, just halving the dot clock and displaying each line of pixels twice. [source]

Conversely, hardware2x apparently just uses the 320x200 image that gets stretched over the entire screen.
Back to top
dosraider
Admin
Admin


Offline
Joined: 15 Mar 2005
Posts: 9259
Location: ROTFLMAO in Belgium.

PostPosted: Wed Apr 30, 2014 11:17 am     Post subject: Reply with quote

... I will assume that by now after digging into those matters you'll comprehend it's a complicated and vast tech area you're playing in.

It's almost not to grasp all those modes for every step the computer graphical hardware made in the past. And add the tricks software devs sometimes applied ....

Headache alley here we come Laughing

Have you ever tried to follow what the newer graphical cards can do ....??? I pass, really, pffffffffffffffffffffffffffffffffffff Shifty
Back to top
MrFlibble
Demoniac Demo maniac
Demoniac Demo maniac


Offline
Joined: 05 Dec 2010
Posts: 2269

PostPosted: Wed Apr 30, 2014 12:05 pm     Post subject: Reply with quote

Heh, I was never really into the tech side of computer stuff, so it's nice to learn something new Happy
Back to top
Display posts from previous:   
Post new topic   Reply to topic    DOS Games Discussion Forum Index -> General Gaming All times are GMT - 5 Hours
Page 1 of 1

 
Free Windows games


Powered by phpBB © 2001, 2005 phpBB Group and Ask an Expert
Also powered by Darren and the other admin and mods' hard work! ;)