MAME HLSL CRT SCANLINE EMULATION PRESETS

The place for all discussion on gaming hardware
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 »

Mame4Life wrote:Thanks for that...but it's not playing ball with Mame 149 which I'm using, just get a black screen... :(

Apparently that modified file needs the 150 shader files...which don't work with 149.

I don't want to update to 150 because the damn Mame dev's removed the ability to write & save HLSL .ini settings via the in game sliders, you now have to manually edit the .ini files for each game. :roll:

Sigh...it's never simple is it.
Theres a link on the first page of that thread with another post.fx which i THINK is for older versions of mame, give that one a 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 »

MAME 0.151 is out
Mame4Life
Posts: 12
Joined: Wed Jul 03, 2013 1:54 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Mame4Life »

lettuce wrote:
Theres a link on the first page of that thread with another post.fx which i THINK is for older versions of mame, give that one a go
Lol..I tried that, unfortunately it just downloads the updated 150 file as well.
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 »

Mame4Life wrote:
lettuce wrote:
Theres a link on the first page of that thread with another post.fx which i THINK is for older versions of mame, give that one a go
Lol..I tried that, unfortunately it just downloads the updated 150 file as well.
99.9% of your mame 0149 roms should still work with Mame 0150 maybe install 0150 into a different directory and try it
Overkill wrote:MAME 0.151 is out
Anything of importance in regards to HLSL???
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 »

Regarding HLSL i only see this:

"- 05300: [Core] HLSL w/Vector Games: Black screen with -HLSL (hap)"
User avatar
nesrulz
Posts: 182
Joined: Wed Nov 13, 2013 6:01 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by nesrulz »

lettuce wrote:
Mame4Life wrote:
lettuce wrote:And also using an modified Post.FX to add the screen cure and rounded corners
Could you provide a link to that or the settings used so I could copy and paste into the file myself...thnx
http://www.aep-emu.de/index.php?name=PN ... fb073a3f82

Last post in that thread, save the post.fx

http://forum.arcadecontrols.com/index.p ... 470.0.html

and info on the prescale.fx file here
Nice settings, thx.
Work fine with UME 0.151.
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 »

Updated for 151. Using a Lenovo W510 for testing. Colours/contrast very close to the Toshiba PF I have in a cab.

Code: Select all

#
# CORE SCREEN OPTIONS
#
brightness                1.0
contrast                  0.9
gamma                     0.8
pause_brightness          1.0
effect                    none
#
# DIRECT3D POST-PROCESSING OPTIONS
#
hlsl_enable               1
hlslpath                  hlsl
hlsl_prescale_x           0
hlsl_prescale_y           0
hlsl_preset               -1
hlsl_write                
hlsl_snap_width           2048
hlsl_snap_height          1536
shadow_mask_alpha         0.05
shadow_mask_texture       aperture.png
shadow_mask_x_count       320
shadow_mask_y_count       240
shadow_mask_usize         0.18750
shadow_mask_vsize         0.21875
curvature                 0.03
pincushion                0.03
scanline_alpha            1.0
scanline_size             1.0
scanline_height           1.0
scanline_bright_scale     1.5
scanline_bright_offset    0.0
scanline_jitter           0.0
defocus                   0.0,0.0
converge_x                -0.3,0.0,0.3
converge_y                -0.3,0.0,0.3
radial_converge_x         0.0,0.0,0.0
radial_converge_y         0.0,0.0,0.0
red_ratio                 1.0,0.0,0.0
grn_ratio                 0.0,1.0,0.0
blu_ratio                 0.0,0.0,1.0
saturation                1.0
offset                    0.0,0.0,0.0
scale                     1.0,1.0,1.0
power                     1.0,1.0,1.0
floor                     0.01,0.01,0.01
phosphor_life             0.0,0.0,0.0

#
# BLOOM POST-PROCESSING OPTIONS
#
vector_bloom_scale        0.3
raster_bloom_scale        0.17
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
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 »

milligoodz wrote:In my opinion it is much better to use a reference HLSL setting for all games in MAME and adjust the gamma for the drivers that needs it. Neo-Geo games might need an increased gamma value (>1.3+) in neodrvr.ini to compensate the lost black levels, Other drivers like system1.ini might need a lower gamma value than default (0.7 or lower to look right). e.g, other games that also need lower gamma values: Kid Niki, Kung-Fu Master, Wonder Boy etc.
This, in spades. Unless I'm mistaken it appears that the gamma in MAME is generally incorrect (too high) with or without hlsl. I need to do a ton more playing around, but for example with nothing else altered away from default settings in MAME:

gunlock - 0.5
ibara - 0.75
neogeo - 0.75
cps2 - 0.6
blktiger - 0.5
rtype - 0.6

It's making me wonder if every driver needs its gamma setting - and if being too high is a general bug across all of them as it's not accurate.
Image
User avatar
nesrulz
Posts: 182
Joined: Wed Nov 13, 2013 6:01 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by nesrulz »

cools wrote:Updated for 151. Using a Lenovo W510 for testing. Colours/contrast very close to the Toshiba PF I have in a cab.
Thx. 8)
Very nice settings.
User avatar
nesrulz
Posts: 182
Joined: Wed Nov 13, 2013 6:01 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by nesrulz »

btw, I use your 0.151 settings with this post.fx. What do you think about that?

https://dl.dropboxusercontent.com/u/541 ... er/post.fx
Mame4Life
Posts: 12
Joined: Wed Jul 03, 2013 1:54 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Mame4Life »

cools wrote:
milligoodz wrote:
This, in spades. Unless I'm mistaken it appears that the gamma in MAME is generally incorrect (too high) with or without hlsl. I need to do a ton more playing around, but for example with nothing else altered away from default settings in MAME:

Some of the 3D CHD games are completely unplayable until you fix the gamma on them, usually the 3DFX based ones like Mace The Dark Age and San Francisco Rush.

I agree, Mame's Gamma settings are all over the place, and need correcting for almost each and every game.
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

Gameboy mode

Image

Color-dependent games are now playable.








CGA mode

Image

Anyone remember DOS games with only 4 colors? ....yes i know this screenshot has more than 4 colors.








AB mode

Image

"AB" stands for AKIRA bike. Anyone remember that crazy cartoon?






- Downloads are coming soon -
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 »

good to see you back!
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 »

NUeda can't wait for your new settings regarding HLSL :P
Scarhelm
Posts: 8
Joined: Mon Apr 15, 2013 3:53 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Scarhelm »

looking forward to see your new settings NUeda, maybe you should start your own post so you can display more information/images and update it easyer. I find all the info youve added interesting to view
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

Happy New Year, fellow gamers.




INI Creator v0.3 (50 systems + 51 ROMs + EXTRA)
CRC: 6A8B2D33
Download mirror 1
Download mirror 2
=============================================================================================






(Click on screenshots to view full-size 1080p images)


Donkey Kong 1981

Image






Xevious 1982

Image





Nemesis 1985

Image

Image






Street Smart 1989

Image






Street Fighter II' CE Xiang Long 1992

Image






Pnickies 1994

Image






Darkstalkers 1994

Image






JoJo's Bizarre Adventure 1999

Image






Gunbird 1994

Image






Samurai Shodown 4 1996

Image

Image






KOF 99 1999

Image







EXTRA mode:
CGA

Image


Image


Image


Image


Image


Image






EXTRA mode:
GAME BOY

Image


Image


Image


Image


Image






EXTRA mode:
MEGALO

Image


Image


Image


Image






EXTRA mode:
AKIRA BIKE

Image _ Image

Image _ Image






=============================================================================================
INI Creator v0.3 (50 systems + 51 ROMs + EXTRA)
CRC: 6A8B2D33
Download mirror 1
Download mirror 2


This package is not compatible with older version, so please don't mix files.
If you want to use different HLSL settings,
please use a text editor to change the contents of *.ini and *.txt files.






---------------------------------------------------------------------------------------------------------------------
How to install:
---------------------------------------------------------------------------------------------------------------------

1. Download the zip file and extract the contents into a new folder.
The folder can have any name you like, but for the sake of this explanation let's name it
_INI_creator_v0.3



2. Place this folder inside your mame folder, on the same level as ini folder.

mame
L..... _INI_creator_v0.3
L..... ini
L..... mame.exe



3. Go inside the folder and run INI_creator_v0.3.bat, and finish the batch process.
You're done now.






---------------------------------------------------------------------------------------------------------------------
Notes:
---------------------------------------------------------------------------------------------------------------------

1. You were right about games being too dark with my HLSL settings.
The most noticeable was Neo-Geo games. Majority of those codes are fixed now.



2. Floor is lowered to 0.0
because most people's monitors already have plenty of backlight bleeding.
It's up to you if you want to raise floor.



3. Bilinear filtering was force-enabled since MAME 0.148u5.
But with MAME 0.152, it is once again turned off by default.

Because of this, I personally think that
MAME 0.152 needs little bit of defocus (already applied in INI Creator v0.3),
whereas
MAME 0.151 needs defocus turned off. (0.0,0.0)

So, if you are using MAME 0.148u5 ~ 0.151, do the following:

go to _INI_Creator_v0.3 folder,
open 0_raster_common.ini in a text editor,
find defocus and change it to 0.0,0.0
and save it,
and run INI_creator_v0.3.bat.






Image
"shin! shoryuken!"
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 »

Glad to see you back NUeda, great work with this new INI creator!. So does this cover all major systems now, such as Konami, Capcom, Temco, Namco, Sega, SNK, Cave etc. As you stated 50 system but not said what the 50 systems are?
User avatar
cmoses
Posts: 30
Joined: Fri May 24, 2013 1:40 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by cmoses »

NUeda,

Thank your for this update. I will give it a try to see the results. Do you need a clean, unedited MAME.ini file to do this? Should you delete your current one and create a fresh one by running MAME.exe -cc prior to running the ini creator?
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

Thank you Fudoh, Overkill, Scarhelm.

As for starting a separate post/thread, I lack the motivation to do that. :(






lettuce,

No, current progress is not even close to supporting all systems from those companies.
As of now, a lot of SNK and Capcom systems are covered, but even those are not complete.

The main change in INI Creator v0.3 compared to older version is just the quality of picture output.
(less distortion in color/brightness, and bloom is fully utilized now)

The total number of systems supported hasn't grown much yet.
And even when a system is supported,
there could be a few odd games that I overlooked which need a different setting.
Segas32.c is like that, most of its games fit under the same HLSL preset, but some need a different preset.


Tell me exactly what game you want, then I could look into that first.
I was asked to deal with really old games first (Donkey Kong, Galaga, Joust)
and those are all supported now.







cmoses,

As far as I know, you don't have to change mame.ini.

INI Creator is designed to work without mame.ini in terms of HLSL settings,
so even when HLSL is turned off in mame.ini, the *.ini files for each system will have code that enables HLSL.
Last edited by NUeda on Thu Jan 02, 2014 11:47 am, edited 2 times in total.
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 »

Great work NUeda, we all apreciate it. It's been a great improvement in HLSL since you got it in. I've just tested a few CPS1 and Neogeo games and looks great
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

enjoy your game, sir. :mrgreen:
Scarhelm
Posts: 8
Joined: Mon Apr 15, 2013 3:53 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Scarhelm »

nice settings look great on my standard pc crt
User avatar
cmoses
Posts: 30
Joined: Fri May 24, 2013 1:40 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by cmoses »

Tested and looks good but with the prescale set to 7 it bogs the games down to unplayable levels. I took some screenshots at default settings and then changed the prescale to 0. Compared and without the prescale the screens were now a bit blurry as expected. I set the defocus to 0.0 and took some screenshots and the pictures look like identical to the default settings.

Metal Slug running with default settings

http://img197.imageshack.us/img197/5125/mzva.png

Metal Slug running with prescale set to 0 and defocus set to 0

http://img46.imageshack.us/img46/7156/ayyp.png

Open them in separate tabs and compare by switching between the two. Let me know if you think they look similar.
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

That looks great !
If my PC had to use internal graphics or older video card, I would totally go with your solution, the screens look practically identical.



Here's the problem though, vertical-scrolling screens with white backgrounds will show a very distracting visual pattern.

Code: Select all

hlsl_prescale_x           0
hlsl_prescale_y           0

defocus                   0.0,0.0
Image

(If the irregular lines can't be seen, please try standing far away from the monitor.)






Now there aren't too many screens like this in games,
which is why I think your solution will be more efficient in terms of GPU power and still look good.

But instead of using 0 for both hlsl_prescale_x and hlsl_prescale_y,
can you try and see if you get good framerate with the following numbers?:

Code: Select all

hlsl_prescale_x           0
hlsl_prescale_y           7

defocus                   0.0,0.0
hlsl_prescale_x was set as high as 7 only because of playing vertical games
on a non-rotating horizontal monitor, like a TV or a projector.

If your monitor is rotated for vertical games, or if you don't play vertical games,
then you don't need 7 for hlsl_prescale_x, it can be 0 and it will look fine.





If you want to apply this change to all games at once, change into the following code before running the batch process:

INI_creator_prescale.txt

Code: Select all

224		0	7

240		0	6
0_raster_common.ini

Code: Select all

defocus                   0.0,0.0



I just realized I could have used
hlsl_prescale_x 0 for all horizontal games
and
hlsl_prescale_y 0 for all vertical games.

It will likely be implemented in the next version.



Thanks for helping out! I need more input like this! :mrgreen:
User avatar
cmoses
Posts: 30
Joined: Fri May 24, 2013 1:40 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by cmoses »

But instead of using 0 for both hlsl_prescale_x and hlsl_prescale_y,
can you try and see if you get good framerate with the following numbers?:

Code: Select all

hlsl_prescale_x           0
hlsl_prescale_y           7

defocus                   0.0,0.0
I gave this a try and Metal Slug now runs at about 50% compared to 10% before. So it's better but still not really playable.

You must have a pretty beefy video card in your system, what are you running out of curiosity?

Also if you are looking for a game to work on settings for, please consider Toobin'. It run at a 512 x 384, so I think it was considered Med Resolution. Normal HLSL settings on it don't look good, the scanlines are too thick.
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 »

Why are you just trying those two prescale extremes ? What about setting prescale to lower values, but not zero ? Prescale 2 is what I used all the time before the HLSL days.
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 »

Prescale 7 is crazy unless you're on a ~2500x1600 screen, in which case it makes a bit of sense but its likely double what's needed for a CRT simulation.
Image
User avatar
cmoses
Posts: 30
Joined: Fri May 24, 2013 1:40 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by cmoses »

Fudoh wrote:Why are you just trying those two prescale extremes ? What about setting prescale to lower values, but not zero ? Prescale 2 is what I used all the time before the HLSL days.
Prescale set to 0 is not turning it off, 0 is the equivalent of Auto. It determines the best prescale for you.

From the mamedev.org docs page - http://mamedev.org/source/docs/hlsl.txt

hlsl_prescale_x [horizontal] HLSL pre-scale override factor for X (0 for auto).
hlsl_prescale_y [vertical] HLSL pre-scale override factor for Y (0 for auto).
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 »

prescale 3 is the sweet spot for me, not demanding and gives a nice crispy image.

Question what is the difference between:

Prescale

and

hlsl_prescale_x
hlsl_prescale_y

?

As if having a value set at just for one and then leaving the other without a value, ie

Prescale 0
hlsl_prescale_x 3
hlsl_prescale_y 3

or

Prescale 3
hlsl_prescale_x 0
hlsl_prescale_y 0

Doesnt seem to have much of any impact on the image, but if you set all 3 to the same value then it makes a massive difference!. In my case

Prescale 3
hlsl_prescale_x 3
hlsl_prescale_y 3
bulbousbeard
Posts: 110
Joined: Sun Nov 03, 2013 5:17 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by bulbousbeard »

Just so you guys know, I spoke with Mooglyguy, and he agrees that the default HLSL settings suck ass.

If you guys can come to some consensus about what the default settings should be, I'll submit a diff to get it added to MAME.
Post Reply