MAME HLSL CRT SCANLINE EMULATION PRESETS

The place for all discussion on gaming hardware
Post Reply
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

cmoses,

The screenshots are taken in 0.148u5, using custom HLSL settings.
I'm almost done with running final checks on the numbers, so I will post everything within a few days.

I will also explain how 80's Japanese games are calibrated differently from the 90's. :shock:
(that's why they should use different HLSL settings)

Cheers
User avatar
Fudoh
Posts: 13015
Joined: Mon Mar 06, 2006 3:29 am
Location: Germany
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Fudoh »

I will also explain how 80's Japanese games are calibrated differently from the 90's
looking very much forward to this. The ultra-high gamma on many of the 80s boards was always a real pain. Your snapshots look amazing (although a little too soft for my taste).
User avatar
cools
Posts: 2055
Joined: Mon Nov 26, 2007 4:57 pm
Location: South Wales
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by cools »

Dropping the DC Offset to -0.4 or thereabouts and pushing the Scale values up to 1.5 seems to be close to what you've screenshotted.

Very curious as to what your settings will be! :) And the reasons for them - I've done a quick scan of various bits of information on the net and understand about the black level and DC offset relation, but haven't got a clue why they need to be corrected in MAME itself.
Image
User avatar
cools
Posts: 2055
Joined: Mon Nov 26, 2007 4:57 pm
Location: South Wales
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by cools »

Basically fixes colours on all 80s games. Alcon, Rtype, Super Contra, Fantasy Zone etc all look way better.
Image
User avatar
BuckoA51
Posts: 3358
Joined: Sat Oct 02, 2010 10:08 am
Location: Ireland
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by BuckoA51 »

I will also explain how 80's Japanese games are calibrated differently from the 90's.
This kind of thing is why I love this forum :mrgreen: Looking forward to seeing those new settings too.
OSSC Forums - http://www.videogameperfection.com/forums
Please check the Wiki before posting about Morph, OSSC, XRGB Mini or XRGB3 - http://junkerhq.net/xrgb/index.php/Main_Page
YountMJ
Posts: 1
Joined: Thu Jun 06, 2013 7:19 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by YountMJ »

I registered for two reasons:

First and foremost, to thank everyone in this thread for submitting what I consider to be excellent HLSL settings. I thought I had been coming up with some extremely convincing settings on my own, until I A/B compared with some of these. They're superb... top-notch!

Secondly, to relay a bit of possible bad news... very, very bad news:

http://git.redump.net/mame/commit/?id=2 ... 57687785ac

The timing sucks, with 0.149 right around the corner.

I certainly hope this isn't true. Without knowing the details, the removal of the code seems like petty retribution for something.

Anyway, thank you again for your submissions. They're looking great on my PC!
User avatar
cools
Posts: 2055
Joined: Mon Nov 26, 2007 4:57 pm
Location: South Wales
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by cools »

Haze reversed that commit pretty sharpish.
Image
User avatar
trap15
Posts: 7835
Joined: Mon Aug 31, 2009 4:13 am
Location: 東京都杉並区
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by trap15 »

lmao mooglyguy
@trap0xf | daifukkat.su/blog | scores | FIRE LANCER
<S.Yagawa> I like the challenge of "doing the impossible" with older hardware, and pushing it as far as it can go.
User avatar
cools
Posts: 2055
Joined: Mon Nov 26, 2007 4:57 pm
Location: South Wales
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by cools »

The presets that were changed were hardly better either ;)
Image
User avatar
cmoses
Posts: 30
Joined: Fri May 24, 2013 1:40 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by cmoses »

NUeda wrote:cmoses,

The screenshots are taken in 0.148u5, using custom HLSL settings.
I'm almost done with running final checks on the numbers, so I will post everything within a few days.

I will also explain how 80's Japanese games are calibrated differently from the 90's. :shock:
(that's why they should use different HLSL settings)

Cheers
Thanks for the info, looking forward to your settings. Yes there is no one setting that works best for all MAME games. There might be a good compromised all around setting, but to get the most out of each game or at least types of games I think there needs to be different settings. Early 80's games with low res monitors and primarily black backgrounds (Donkey Kong, Ms. PacMan, Galaga) and going to need one type of setting. Late 80's into 90's games with medium to high res monitors and vibrant colorful backgrounds will need another type of setting. I usually use a few of games when testing HLSL settings, a mix of older black backgrounds and newer colorful backgrounds. It's very difficult to find a single HLSL setting that they all look good in.

Looking forward to your settings and explanations.
User avatar
lettuce
Posts: 1334
Joined: Wed Jun 22, 2011 7:10 pm
Location: Bedfordshire, England.

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by lettuce »

YountMJ wrote:I registered for two reasons:

First and foremost, to thank everyone in this thread for submitting what I consider to be excellent HLSL settings. I thought I had been coming up with some extremely convincing settings on my own, until I A/B compared with some of these. They're superb... top-notch!

Secondly, to relay a bit of possible bad news... very, very bad news:

http://git.redump.net/mame/commit/?id=2 ... 57687785ac

The timing sucks, with 0.149 right around the corner.

I certainly hope this isn't true. Without knowing the details, the removal of the code seems like petty retribution for something.

Anyway, thank you again for your submissions. They're looking great on my PC!
so 0.148u5 will be the last version to have HLSL settings?
User avatar
trap15
Posts: 7835
Joined: Mon Aug 31, 2009 4:13 am
Location: 東京都杉並区
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by trap15 »

No, it was restored pretty much immediately after it was removed. Silly schoolyard in-fighting.
@trap0xf | daifukkat.su/blog | scores | FIRE LANCER
<S.Yagawa> I like the challenge of "doing the impossible" with older hardware, and pushing it as far as it can go.
User avatar
Overkill
Posts: 512
Joined: Mon Aug 22, 2011 6:11 pm
Location: Portugal

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Overkill »

Maybe we could start making settings for the most used PCBs, like settigs for CPS1, 2, Neogeo MVS, and then go adding new settings for each others pcbs available
CMPXCHG8B
Posts: 139
Joined: Wed Jul 13, 2011 8:55 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by CMPXCHG8B »

Who is Tafoid and why couldn't he take a simple joke?

I am curious. When the cavesh3.c stuff went down, there were people saying that other folks owned portions of that code and they had the right to pull it from the repo, please respect their decision, etc.

So does this guy not have the same right to pull HLSL? I mean, wasn't he the guy who wrote it?

PS: I'm aware everyone loves HLSL and so do I. I'm just wondering what the justification was for reverting those changes when I was under the impression that the code authors retained copyright over their own code submitted to MAME.

-CMPX
User avatar
trap15
Posts: 7835
Joined: Mon Aug 31, 2009 4:13 am
Location: 東京都杉並区
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by trap15 »

Short version: MooglyGuy (who wrote the HLSL stuff) is fucking crazy and acts like a kid. Got angry at some small things said on the Bannister Shoutbox and pulled HLSL because he could.

The CV1000 stuff isn't related to that; that was a decision by MAMEdev as a whole.
@trap0xf | daifukkat.su/blog | scores | FIRE LANCER
<S.Yagawa> I like the challenge of "doing the impossible" with older hardware, and pushing it as far as it can go.
CMPXCHG8B
Posts: 139
Joined: Wed Jul 13, 2011 8:55 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by CMPXCHG8B »

Yeah, I get that part.

I was just wondering if he had the right to pull that code, and if MAMEdev had the right to put it back. That was the jive I got from the CV1000 stuff- that it was the authors code, and they had the right to do whatever they wanted with it.

-CMPX
User avatar
trap15
Posts: 7835
Joined: Mon Aug 31, 2009 4:13 am
Location: 東京都杉並区
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by trap15 »

The author of the CV1000 driver didn't even get to see the C&D, so no, the situations aren't similar. Also, any code contributed to MAME is MAMEdev's. You cannot retroactively say "oh wait no, this is mine, sorry". Licensing~
@trap0xf | daifukkat.su/blog | scores | FIRE LANCER
<S.Yagawa> I like the challenge of "doing the impossible" with older hardware, and pushing it as far as it can go.
CMPXCHG8B
Posts: 139
Joined: Wed Jul 13, 2011 8:55 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by CMPXCHG8B »

Ah, OK. Thanks for clarifying.

-CMPX
User avatar
Overkill
Posts: 512
Joined: Mon Aug 22, 2011 6:11 pm
Location: Portugal

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Overkill »

Its gonna be on theaters soon, like in the movie "The Social Network" :lol:
User avatar
cools
Posts: 2055
Joined: Mon Nov 26, 2007 4:57 pm
Location: South Wales
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by cools »

Overkill wrote:Maybe we could start making settings for the most used PCBs, like settigs for CPS1, 2, Neogeo MVS, and then go adding new settings for each others pcbs available
It's more about the typical monitor technology used at the time the game was released than the PCB.

What would be nice is if some good presets made it in to the code, so that hlsl_preset was worth using and could be documented properly - i.e. use hlsl_preset 1 for NTSC over RF, hlsl_preset 2 for an 80s arcade RGB monitor, hlsl_preset 3 for a modern arcade monitor etc.
Image
User avatar
Overkill
Posts: 512
Joined: Mon Aug 22, 2011 6:11 pm
Location: Portugal

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Overkill »

hope someone in the MAME team thinks about that, it will be worthy
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

HLSL ['86 Japan] mode v1.01
Formerly "Film mode", "80's mode". Updated 2013-06-17 (MMDD)


v1.01 details:
-------------------------------------
1. Name was changed to make sense

2. Code was changed to clean up the color (it was muddy and cold-looking)

3. Code was changed to brighten everything by one step (it was dark in general, even besides the black crush)





Teenage Mutant Ninja Turtles 1989

Image

Image

Image
Click to view 1600x1200






Final Fight 1989

Image

Image

Image
Click to view 1600x1200






----------------------------------------------------------------
Appropriate games
----------------------------------------------------------------
Capcom: Slam Masters upgrades, Street Fighter II upgrades, and CPS-1 (and older)

I'm not too sure about Punisher, Cadillacs and Dino, Warrior of Fate .....


Data East: Robocop 2

Konami: TMNT 1 (and older)

Sega: System 18, System 16 (and older)

----------------------------------------------------------------
Problematic games
----------------------------------------------------------------
Data East: Robocop 1 (2nd stage bg is too dark)

SNK: everything

----------------------------------------------------------------


This HLSL mode will compensate for the overly bright colors and the slightly yellow skew of 80's Japanese games,
and make them look correct and balanced.
It is done by cutting off quite a lot of dark colors and then applying a number of other minor tweaks.

If you use this on 90's games, most of them will look noticeably dark compared to 80's games.
Some games, like KOF98, will look so dark that it gets uncomfortable to look at.

And there are a few 90's games that use bright colors, and should use this mode.
(Street Fighter 2 upgrades (SF2 ~ HSF2) and Slam Masters upgrades)












- Link deleted for being oudated -













---------------------------------------------------------------------------------------
What are some upcoming changes?

1. Aperture (Shadow Mask)

Right now, the aperture pattern is only barely visible.
It can't be helped, when the aperture is emphasized, the entire screen starts showing a messy pattern
and it's just way too dark to pretend I'm looking at CRT dot pitch or shadow mask.

It's just something very difficult to do correctly on 1080p LCD monitors.
I'm holding off on this until 4k monitors become the norm.
.....and VERY high contrast ratio will be needed too in order to make this look right.



2. Bloom

I haven't yet figured out a good number for bloom; 0.1 is just a temporary solution.

---------------------------------------------------------------------------------------






==========================================================================================================




- This portion deleted for rambling without proper research -




==========================================================================================================






--------------------------------------------------------------------------------------

Street Fighter II 1991

Image

Image

Image
Click to view 1600x1200






Golden Axe 1989

Image

Image

Image
Click to view 1600x1200



The above is HLSL ['86 Japan] mode.
For games that do not use the bright color palette of 80's games, there is HLSL ['91 Japan] mode.

=========================================================================================








- Link deleted for being oudated -
Last edited by NUeda on Thu Jan 02, 2014 12:33 pm, edited 47 times in total.
User avatar
trap15
Posts: 7835
Joined: Mon Aug 31, 2009 4:13 am
Location: 東京都杉並区
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by trap15 »

You are doing the lord's work, my friend :shock: Keep this up, I'm heavily intrigued.
@trap0xf | daifukkat.su/blog | scores | FIRE LANCER
<S.Yagawa> I like the challenge of "doing the impossible" with older hardware, and pushing it as far as it can go.
User avatar
emphatic
Posts: 7918
Joined: Mon Aug 18, 2008 3:47 pm
Location: Alingsås, Sweden
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by emphatic »

This is amazing and the work you've done is terrific! :D
Image | My games - http://www.emphatic.se | (Click) I have YEN stickers for sale
RegalSin wrote:Street Fighters. We need to aviod them when we activate time accellerator.
User avatar
cools
Posts: 2055
Joined: Mon Nov 26, 2007 4:57 pm
Location: South Wales
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by cools »

I'm somewhat dubious about the thinking behind why the different settings are required, but you're 100% correct in pointing out that they use different dynamic ranges.

Super Contra is a very good example. Check its colour test screen. Native it's too bright, but adjusting the offset and scale alters the range significantly.
Image
User avatar
lettuce
Posts: 1334
Joined: Wed Jun 22, 2011 7:10 pm
Location: Bedfordshire, England.

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by lettuce »

Jesus Christ!!, such an informative post NUeda! Now If there was some way to make a batch file that could automatically make ini files for each game so they use the correct HLSL setting (Film, reference etc) that would be the icing on the cake. Is a 1440p monitor still not enough to emulate shadowmask effect correctly?

Have you tried messing around with the 'Floor' setting in HLSL, it kind of simulates a light behind the screen, so rather than a black screen being pitch black (which it would never be on a CRT) it's more of a very dark grey or lighter black, so kind of simulates the CRT glow through the screen
User avatar
Overkill
Posts: 512
Joined: Mon Aug 22, 2011 6:11 pm
Location: Portugal

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Overkill »

How! i come back here and such an update this thread have. Great job NUeda, love reading it all. Can't wait for more HLSL settings to come (Neogeo, etc)
milligoodz
Posts: 3
Joined: Sun Jun 09, 2013 1:18 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by milligoodz »

^

Greetings!

There is no need for a batch file for different HLSL presets; you could just create a custom ini-file in the default mame (ini) folder.

For example:

neodrvr.ini (for all the NeoGeo Games)
cps1.ini (for all the Capcom System 1 Games) etc.

or gamename.ini (example ffight.ini) if you would want to use custom settings for a specific game etc.


At this moment I don’t recommend spending much time to change the HLSL settings for each specific game individually due to the upcoming changes to the HLSL source, change it at the driver level instead; cps1.ini/cps2.ini/segas16a.ini/segas16b.ini etc. and it will be much easier to correct these later as compared to thousand separate ini’s.



--------------------------
Here are my custom HLSL settings that I currently use and it is optimised for v0.148u5 as a compromise for both older and newer games. It works great as a baseline if you only wish to use a single preset for all games. You will still have to tweak it and calibrate it for you specific monitor. I’ll post some screenshots later. You might have to adjust (lower or increase) the gamma setting in your ini if the image is too dark or bright.
---------------------------

PS. Tips to reduce moiré: use the game video output resolution (ingame/TAB/Game Information) and set it as the default shadow_mask_x and y count for that game or driver.
For example:

Use these in your neodrvr.ini for all your neogeo games:

shadow_mask_x_count 320
shadow_mask_y_count 224

and for cps1.ini & cps2.ini

shadow_mask_x_count 384
shadow_mask_y_count 224

etc.

Code: Select all

#
# DIRECT3D POST-PROCESSING OPTIONS
#
hlsl_enable               1
hlslpath                  hlsl
hlsl_ini_read             0
hlsl_ini_write            0
hlslini                   %g
hlsl_prescale_x           3
hlsl_prescale_y           3
hlsl_preset               -1
hlsl_write                0
hlsl_snap_width           1024
hlsl_snap_height          768
shadow_mask_alpha         0.05
shadow_mask_texture       aperture.png
shadow_mask_x_count       320
shadow_mask_y_count       240
shadow_mask_usize         0.09375
shadow_mask_vsize         0.109375
curvature                 0.01
pincushion                0.01
scanline_alpha            0.3
scanline_size             1.0
scanline_height           1.0
scanline_bright_scale     1.35
scanline_bright_offset    0.35
scanline_jitter           0.1
defocus                   1.2,1.0
converge_x                -0.1,0.0,0.1
converge_y                0.1,0.0,-0.1
radial_converge_x         2.0,0.0,-2.0
radial_converge_y         -1.0,0.0,1.0
red_ratio                 1.05,0.04,-0.1
grn_ratio                 0.0,1.05,0.0
blu_ratio                 -0.04,-0.04,1.06
saturation                1.056
offset                    -0.037,-0.04,-0.045
scale                     1.13,1.15,1.19
power                     1.56,1.47,1.25
floor                     0.06,0.07,0.08
phosphor_life             0.16,0.17,0.18
raster_bloom_scale 	    0.155
User avatar
Overkill
Posts: 512
Joined: Mon Aug 22, 2011 6:11 pm
Location: Portugal

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Overkill »

For example:

neodrvr.ini (for all the NeoGeo Games)
cps1.ini (for all the Capcom System 1 Games) etc.
That .ini file will have all the rest of the info as in MAME.ini, or just the "#DIRECT3D POST-PROCESSING OPTIONS" section?
milligoodz
Posts: 3
Joined: Sun Jun 09, 2013 1:18 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by milligoodz »

Overkill wrote:That .ini file will have all the rest of the info as in MAME.ini, or just the "#DIRECT3D POST-PROCESSING OPTIONS" section?
You can just use any part (single line or multiple lines) from the mame.ini that you wish to customize in your custom ini file and it will override the defaults for those parts that you’ve added. Cheers

---

It is indeed very useful, especially for vector games. For example save the code blow as vector.ini and it will add motion-trail and much increased vector bloom glow effects and phosphor bleeding as compared to the default MAME settings for all the vector-games.
#
# CORE VECTOR OPTIONS
#
antialias 1
beam 1.4

#
# VECTOR POST-PROCESSING OPTIONS
#
vector_time_scale 0.0
vector_time_period 0.1
vector_length_scale 0.8
vector_length_ratio 500.0

#
# BLOOM POST-PROCESSING OPTIONS
#
vector_bloom_scale 0.350
raster_bloom_scale 0.1
bloom_lvl0_weight 1.0
bloom_lvl1_weight 0.21
bloom_lvl2_weight 0.19
bloom_lvl3_weight 0.17
bloom_lvl4_weight 0.15
bloom_lvl5_weight 0.14
bloom_lvl6_weight 0.13
bloom_lvl7_weight 0.12
bloom_lvl8_weight 0.11
bloom_lvl9_weight 0.10
bloom_lvl10_weight 0.09

#
# PHOSPHOR LIFE TO SIMULATE MOTION TRAIL
#
phosphor_life 0.650000,0.650000,0.650000
Post Reply