MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

TServo2049
Lurker
Reged: 11/24/03
Posts: 60
Send PM


What work would need to be done to get more accurate vector shaders?
#369218 - 08/31/17 04:50 PM


Hello,

The following is not a demand for someone to develop something I want. It's purely for my own enlightenment. I don't know enough coding to contribute to any effort to make this possible, but I am still curious about what it would take to achieve it. Now, with all that out of the way...

When I was at California Extreme back in July, I again marveled at how classic vector games look (at least when they weren't converted to run on raster monitors or whatever it was that made some of the color ones look like they had bits eaten out of the lines and weird aliasing/"interlacing"(?) effects where an entire line was not visible at any one point in time, just different parts of it at different times...). It got me to thinking about what would need to be done to get more accurate vector shaders/filters in MAME. All the current CRT filters out there are understandably oriented toward raster-based games. The vector filters and HLSL help achieve something kind of sort of close to a real display, but there is still a long way to go before shaders can approximate the real thing for vector as much as raster.

My question is, what would need to be done to be able to achieve things such as variable intensity of vectors? On a real vector display, it seems to me that the closer two points are to each other, the brighter and "thicker" the vector gets. When you fire a shot in Asteroids, it is much brighter than any other object on screen, I presume because the draw distance is so short. When objects recede into the background in Tempest, they get brighter. The mazes approach the player as bright bursts of light and get clearer and less bright as they come closer and the distances between each point get longer. The same goes for Star Wars and other games with simulated 3D depth.

Also, due to the nature of shadow masks, color vector games don't have a "consistent" brightness for all objects, something white is brighter than something red or blue, since the presence of color means that light is essentially being filtered out of the visible spectrum. In Star Wars, the TIE Fighters' "fireballs" are brightest where they are white, where the red, green and blue overlap and intersect. And I love the Death Star explosion, which has all of what I describe - the center of the explosion is much brighter than the edges, and the final white explosion is brighter than the preceding red or blue ones. Obviously all displays show white as brighter than anything else, but it feels especially noticeable on an actual color vector display.

This kind of stuff isn't really possible with the current shaders. Everything seems to be uniform brightness and uniform thickness, long vectors have the same amount of decay/ghosting as short bright ones, and the glow seems to be more consistent over the whole image like you'd expect from raster. So, I am curious what the impediments are to achieving such things in shaders. I seem to recall one dev posting somewhere, I forget where, that the vector engine might have to be rethought, that MAME doesn't actually handle vector drawing the same way as real displays, but I may be misremembering. Or maybe it was referring to why bgfx can't apply shaders to vector graphics? Would the current video rendering frameworks allow for intensity control between two X/Y points, better simulation of variable refresh based on vector length, etc., and not just effects to simulate a raster-based environment? And if not, what obstacles still need to be overcome?

I obviously can't develop anything myself, and I'm absolutely not intending this to be some selfish demand for someone else to do something I want. This thread should be free of haranguing of devs to do this or do that. I am legitimately curious about what it might take to do such things in MAME, and why certain things aren't possible in the program right now. It's really just for my own education, so if anyone knows anything about these topics, I'd love to hear it. Thanks!



TServo2049
Lurker
Reged: 11/24/03
Posts: 60
Send PM


Re: What work would need to be done to get more accurate vector shaders? new [Re: TServo2049]
#369220 - 08/31/17 05:08 PM


OK, I think I found what I was remembering, MooglyGuy logged an issue for vector core improvements, and the thread seems to explain a good deal of what I was thinking about why MAME can't yet reproduce some of these things that are part of the look of vector monitors. https://github.com/mamedev/mame/issues/399

That said, even with this I'm still not fully clear on what obstacles remain, or what work still needs to be done. If he or anyone else has any more info, though, please feel free to share it here. Thanks!



Envisaged0ne
MAME Fan
Reged: 08/29/06
Posts: 543
Send PM


Re: What work would need to be done to get more accurate vector shaders? new [Re: TServo2049]
#369229 - 08/31/17 06:38 PM


While this is a vague response, the dev's might enlighten you on what's fully involved - but the gist of what we've always been told is that the way MAME handles vector graphics has to be completely re-written and it would be a long complicated process that no one really wants to do (at least at this point). While that doesn't explain what needs to be done, it sounds like something they're not eager to do because of all the work that will be involved



Windows 11 64 bit OS
Intel Core i7-10700
Nvidia GeForce RTX 2060 6GB
32GB DDR4 RAM



Haze
Reged: 09/23/03
Posts: 5245
Send PM


Re: What work would need to be done to get more accurate vector shaders? new [Re: Envisaged0ne]
#369235 - 08/31/17 07:07 PM


> While this is a vague response, the dev's might enlighten you on what's fully
> involved - but the gist of what we've always been told is that the way MAME handles
> vector graphics has to be completely re-written and it would be a long complicated
> process that no one really wants to do (at least at this point). While that doesn't
> explain what needs to be done, it sounds like something they're not eager to do
> because of all the work that will be involved

basically MAME drivers attempt to snapshot a position in time and call it a frame (there are various hacks in the drivers for this) while real vector monitors don't have such a concept so the timing of the data fed to them is what is important.

MAME needs some much more complex code to simulate the lines, and determine which are visible based on how recently they were written, how bright they were based on how long the beam stayed in one place etc.

That's the dumbed down version anyhow. The code in MAME right now is closer to trying to port the games in a 'convenient for PC users' way, rather than emulate the behaviour of the monitors.



Envisaged0ne
MAME Fan
Reged: 08/29/06
Posts: 543
Send PM


Re: What work would need to be done to get more accurate vector shaders? new [Re: Haze]
#369239 - 08/31/17 07:39 PM


Thank you for the explanation!



Windows 11 64 bit OS
Intel Core i7-10700
Nvidia GeForce RTX 2060 6GB
32GB DDR4 RAM



uman
MAME Fan
Reged: 04/15/12
Posts: 455
Send PM


Re: What work would need to be done to get more accurate vector shaders? new [Re: TServo2049]
#369251 - 08/31/17 09:25 PM


> OK, I think I found what I was remembering, MooglyGuy logged an issue for vector core
> improvements, and the thread seems to explain a good deal of what I was thinking
> about why MAME can't yet reproduce some of these things that are part of the look of
> vector monitors. https://github.com/mamedev/mame/issues/399
>
> That said, even with this I'm still not fully clear on what obstacles remain, or what
> work still needs to be done. If he or anyone else has any more info, though, please
> feel free to share it here. Thanks!

It is indeed a very good description of what is needed and i thank him for this "answer" to a long thread on bannister.org here: http://forums.bannister.org//ubbthreads.php?ubb=showflat&Number=104711&page=1

Basically said, MAME needs a good emulation for vector monitors, because it is not enough to emulate only the pcb-hardware the games used, to achieve the fascinating effects and brightness of the vector drawing phosphors and their trails they leave while moving.

Even if you leave behind the fact, that every driver would need to be rewritten, one argument why nobody has touched this, are the different technologies used in LCD´s and CRT´s. If it comes to brightness and high contrast, a LCD monitor cannot compete with a CRT and at the time Moogly wrote that thread, i would say not even close.

Times have changed and the first LCD monitors with HDR technology are out. HDR could be one answer for most of the problems developers had before, regarding the mimics of phosphor/beam of a CRT.

If you want to know what HDR means: http://www.pcgamer.com/what-hdr-means-for-pc-gaming/



MooglyGuy
Renegade MAME Dev
Reged: 09/01/05
Posts: 2261
Send PM


Re: What work would need to be done to get more accurate vector shaders? new [Re: Envisaged0ne]
#369283 - 09/01/17 09:47 AM


> Thank you for the explanation!

I can confirm that Haze's explanation is spot-on.



anikom15
Instigator/Local CRT Guru
Reged: 04/11/16
Posts: 287
Send PM


Re: What work would need to be done to get more accurate vector shaders? new [Re: uman]
#369300 - 09/01/17 05:16 PM


HDR monitors are still not even close to the contrast capabilities of a vector screen.



anikom15
Instigator/Local CRT Guru
Reged: 04/11/16
Posts: 287
Send PM


Re: What work would need to be done to get more accurate vector shaders? new [Re: Envisaged0ne]
#369301 - 09/01/17 05:44 PM


Thankfully the differences between a raster and vector screen are not as extreme as you might believe. Both are analog and work with similar signals and use the same types of shadow masks and phosphors. The display part of a CRT shader, from the gun to your eye, should be able to be identical for both.

The signals the displays use aren't too different in nature. There are the video signals, RGB, or just Y for monochrome, for both. Rasters have H-SYNC and V-SYNC ramps whereas vectors have arbitrary x and y signals. You can construct frames with strict timing with sync signals but no such thing exists for the vector displays.

If we want to make things like the Apple II or LaserDisc accurate we will have to deal with the video signals directly anyway, and that should naturally lead to work on the vector games hopefully. To have better phosphor effects, especially with the increase of high-speed displays, MAME will have to switch to a new method of display where black frames are inserted (the persistence models keep the screen from actually becoming completely black). Another change is to make the phosphor effect additive instead of the 'lighten only' method it uses now. This should have the potential to make the vector lines look much more realistic. I've been experimenting with this additive method (for rasters) but there are some aesthetic issues and difficulties that people probably won't like.

I can't work on vector things directly, but I will at least try to port it to BGFX along with my other work, and hopefully other work I do will improve vector games as well.



uman
MAME Fan
Reged: 04/15/12
Posts: 455
Send PM


Re: What work would need to be done to get more accurate vector shaders? new [Re: anikom15]
#369317 - 09/01/17 10:53 PM


> HDR monitors are still not even close to the contrast capabilities of a vector screen.

I never said that. I said HDR can improve the mimics of phosphors and that in a way better than regular LCD´s.

> Thankfully the differences between a raster and vector screen are not as extreme as
> you might believe. Both are analog and work with similar signals and use the same
> types of shadow masks and phosphors. The display part of a CRT shader, from the gun
> to your eye, should be able to be identical for both.

Only colored vector CRT´s have a shadowmask, B&W vector CRT´s dont have one. But you are right, there are not much differences. If you know what you are doing, you can convert a B&W CRT into a B&W vector CRT with just little effort.

>To have better phosphor effects, especially with the
> increase of high-speed displays, MAME will have to switch to a new method of display
> where black frames are inserted (the persistence models keep the screen from actually
> becoming completely black).

This method is not new, it is just not supported by MAME yet. Black frame insertion is included in RA, but i think it doesnt work properly.

> Another change is to make the phosphor effect additive
> instead of the 'lighten only' method it uses now. This should have the potential to
> make the vector lines look much more realistic. I've been experimenting with this
> additive method (for rasters) but there are some aesthetic issues and difficulties
> that people probably won't like.
>
> I can't work on vector things directly, but I will at least try to port it to BGFX
> along with my other work, and hopefully other work I do will improve vector games as
> well.

I am really curious, how your changes will look. It sounds interesting.



anikom15
Instigator/Local CRT Guru
Reged: 04/11/16
Posts: 287
Send PM


Re: What work would need to be done to get more accurate vector shaders? new [Re: Haze]
#369319 - 09/02/17 12:23 AM


It's interesting to consider that on a real analog raster monitor the bottom-right pixel will appear about thirteen milliseconds after the top-left pixel. The following top-left pixel appears about seventeen milliseconds after the first top-left pixel. MAME preserves the timing between each pixel at a particular point, but not between neighbors. Do we need to aim to preserve that precision? I say yes.

Edited by anikom15 (09/02/17 12:27 AM)



R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9716
Loc: ECV-197 The Orville
Send PM


Re: What work would need to be done to get more accurate vector shaders? new [Re: anikom15]
#369453 - 09/05/17 10:40 PM


> HDR monitors are still not even close to the contrast capabilities of a vector
> screen.

That's true, but it's an order of magnitude closer than current PC display technology.


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 357 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1281