MAME HLSL CRT SCANLINE EMULATION PRESETS

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

NUeda, fantastic effort on your HLSL write-up! I just think that you're introducing a little too much black-crush with your settings.

And out of interest, does CaveUI 1.3.3 support HLSL ?
User avatar
cmoses
Posts: 30
Joined: Fri May 24, 2013 1:40 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by cmoses »

milligoodz wrote:^
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.
milligoodz,

I will be giving these a try. I am using HLSL on a 19" Dell LCD monitor. It's native resolution is 1280x1024 and it will be in a cocktail cabinet. So pretty close to the screen when viewing.

In most of the settings I have tested I tend to not like the converge_x and converge_y settings. Also the radial converge settings. It creates color bleed and when you are close to the monitor I don't think it tends to look that good. Also I see your using a prescale of 3, but also using defocus. Don't these cancel each other out? Prescale giving you the best picture for the resolution and then using defocus to worsen the picture. Couldn't you just use 0 for prescale and no defocus? I think the results would be similar.

What specific monitor settings would you recommend for my monitor and resolution. Do you think it's best to run at native or 1024x768? Any other tweaks you can suggest?

Thanks
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 fellow gamers for your kind words.

It's really great to see arcade games of the yesteryears
still being appreciated by not just myself alone, but by a huge community of retro gaming fans.
You guys are awesome.



cools,

I agree with you. When I finished writing that out, I started realizing the actual reason couldn't be
that arbitrary and going backwards in the "flow of influence". (come on, really? photography?!)
It's gotta be some other limitation in the hardware department that couldn't be sorted out until the 90's.

How do you get into the color test for Super Contra? Pressing F2 does nothing....



lettuce,

Please go ahead and try raising the number for shadow_mask_alpha, 1440p should give you a VERY good result.
And even if your monitor wasn't high-res, everyone has a different comfort zone,
so try changing that setting to find at what point the screen looks the most pleasing to you.

When I said we need 4k, I was only talking in terms of making it look so convincing that it could fool people. "I can't believe it's not CRT" ?
There are already close-up photos of aperture patterns from the actual CRT's, so when 4k monitors arrive,
it should be possible to just use those images and make it really look authentic.

But then again, those 4k monitors better have really, really high contrast ratio.
That's the other serious problem getting in the way of good simulation of shadow mask on LCD's.

I am aware of the floor setting but I was going for a "color-corrected film" look, so I wanted the blacks to be blaaaaaaaaaacks.
I may end up using raised floor in a different HLSL mode.....




Fudoh,

You are right, there is too much black crush going on.
But this setting (HLSL Film mode) was never about general accuracy, and it is catering only for some games
that have colors that are so bright that the graphics look wrong.

Currently I'm cooking up a different setup (HLSL Reference mode) that does things in moderation, so please give that a try when it's released.
I am not too familiar with CaveUI, sorry....
milligoodz
Posts: 3
Joined: Sun Jun 09, 2013 1:18 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by milligoodz »

NUeda:
Thanks for your previous post (in page5), it was indeed a very interesting read. I’m looking forward to your reference HLSL settings.

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.

--------

cmoses:
Greetings, I’m also using a 19 inch LCD monitor on my bartop with a native resolution of 1280x1024 like yours. The preset below are much more moderate than the previous one. I use defocus x & y values to make the pixels bleed into each other as they did in the original arcade monitor. The HLSL defocus values are much more advanced than just a simple blur-setting that most people assume that it is. According the main developer of HLSL (Just Desserts @ forums.bannister.org), the defocus passes run at render-target resolution and need to take 8 samples for every outgoing pixel, and it does this twice for a smoother blur.This is much slower than usual box-blur or separated gaussian-blur shaders that are present in games, as they typically run at a lower resolution than the final target, not higher. So if you’r GPU can handle it increase the prescale values a bit in order to compensate for the blurriness caused by the defocus values.

Always use your monitors native resolution and calibrate your monitors brightness/contrast/gamma before further adjusting HLSL in MAME in order to not to crush the black levels by mistake in MAME. Cheers

http://www.designerstalk.com/forums/att ... yscale.png


My current reference: (increase or decrease the gamma values depending on your monitor calibration)

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           1280
hlsl_snap_height          1024
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.3
scanline_bright_offset    0.6
scanline_jitter           0.1
defocus                   1.0,0.8
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.05
offset                    -0.05,-0.06,-0.07
scale                     1.01,1.02,1.03
power                     1.4,1.3,1.2
floor                     0.02,0.03,0.04
phosphor_life             0.15,0.15,0.15
raster_bloom_scale 	0.14
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 »

Super Contra test mode is entered by enabling the test mode DIP (pressing F2), resetting the game (pressing F3), then waiting for the crosshatch to appear and using P1 start to cycle through the test screens.

milligoodz: Could you post a screenshot of what your settings look like for you? They give an extremely blurry result here, and lose an awful lot of definition in both the black and full-brightnes areas.
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 »

milligoodz: Could you post a screenshot of what your settings look like for you? They give an extremely blurry result here, and lose an awful lot of definition in both the black and full-brightnes areas
Same here, on a Samsung 1080p lcd
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 »

149 is now out. The defaults are... somewhat odd. But all the sliders are now hooked up properly so it should be straightforward to tweak stuff up.
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 »

Updated the settings on my wiki page to cover the newest release: http://wiki.arcadeotaku.com/w/User:Cool ... L_Settings

I've a inkling I know why older games have a different output to the newer ones, though I'm not certain at all - I think it's just a difference in color space being used during development, YUV vs RGB http://en.wikipedia.org/wiki/List_of_co ... their_uses
Image
fagin
Posts: 1654
Joined: Fri Mar 19, 2010 2:29 pm
Location: UK

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by fagin »

Cools - That doesn't make much sense though considering the output of arcade hardware has always been (for MAME stuff anyhow) based on RGB video.
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 final hardware, yes - but who's to know what the development was actually done with?

I've also found a few bits and pieces about the DC offset of AC coupled monitors... But this is really sparse information and doesn't explain why 80s consoles also seem to be in the same colour space as the arcade boards.
Image
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 »

cools. I'm pretty sure it's related to the screwed 7.5 IRE offset associated with NTSC signals in Japan. Some info here: http://www.glennchan.info/articles/tech ... setup.html
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 »

That looks a likely candidate as well, the timing is quite nice:
In Japan, the standard black level was changed from 7.5 IRE to 0 IRE in 1985. So, Japanese NTSC (informally called NTSC-J) has black level at 0 IRE and white level at 100 IRE.
The question next is, how can we replicate that correctly with the HLSL settings for games that require it?
Image
User avatar
Hunk_4TH
Posts: 4
Joined: Wed Feb 09, 2011 5:03 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Hunk_4TH »

Does anyone else have this issue when enabling HLSL after upgrading to 149? See the screen shot. I can't figure this one out. The pictures seems faded and it has those grids. Sorry for the crappy crappy I took it with my phone because when doing alt and F12 to take an HLSL screenshot it shows up normal lol.

Image
User avatar
cmoses
Posts: 30
Joined: Fri May 24, 2013 1:40 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by cmoses »

I have 149 working fine, no grids here. Have you checked other games? Did you change any HLSL settings from the default ones? Did you create a new MAME.ini file or import one from an older version?
User avatar
Hunk_4TH
Posts: 4
Joined: Wed Feb 09, 2011 5:03 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Hunk_4TH »

I did import my mame ini so maybe it's something there? I just tried a handful of games and they all have the same issue. The HLSL settings are not default btw. Would my ini help?
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

HLSL ['91 Japan] mode v1.01
Formerly "Reference mode", "90'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)


Screenshots are from older version. (1.0)



King of Fighters 98 1998

Image

Image
Click to view 1600x1200




Garou - Mark of the Wolves 1999

Image

Image
Click to view 1600x1200




Art of Fighting 2 1994

Image

Image
Click to view 1600x1200




Metal Slug 1996

Image

Image
Click to view 1600x1200




----------------------------------------------------------------
Appropriate games
----------------------------------------------------------------
Capcom: CPS-3, CPS-2 (exclude Slam Masters 2 and SSF2/X/HSF2)
Punisher, Cadillacs and Dino, Warrior of Fate might belong here.....


Konami: Turtles in Time (and newer)

SNK: none

----------------------------------------------------------------
Problematic games
----------------------------------------------------------------
Neo-Geo games

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


This HLSL mode is for Japanese games released around 1991 (and after) that don't have the overly bright color palettes used during the 80's.
This mode is relatively safe to use on any game
but will push down the darkest colors to black.

For the most part, it's using the same principles as the earlier [80's] mode, posted on page 5.









- Link deleted for being outdated -











---------------------------------------------------------------------------------------
What are some upcoming changes? (same with 80's mode)

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.

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




Mortal Kombat II 1993

Image

Image
Click to view 1600x1200




Robocop 1988

Image

Image
Click to view 1600x1200




Street Fighter III 3rd Strike 1999

Image

Image
Click to view 1600x1200




Progear 2001

Image

Image
Click to view 1600x1200



The above is HLSL ['91 Japan] mode.
=========================================================================================





















=========================================================================================
HLSL [Game Boy] mode v0.5
Updated 2013-06-14 (MMDD)



Alex Kidd 1986

Image






Captain America and The Avengers 1991

Image






Hang-On 1985

Image






Samurai Shodown 1993

Image






Street Fighter 1987

Image






Tetris (Sega) 1989

Image






Teenage Mutant Ninja Turtles 1989

Image






Virtua Fighter 1993

Image





----------------------------------------------------------------
Appropriate games
----------------------------------------------------------------
Games with bright colors and simple background graphics.

I don't have a list yet.

----------------------------------------------------------------
Problematic games
----------------------------------------------------------------
At this point, most games.

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


Please note that this is a novelty mode, just for trying once or twice but not for extensive use.



- Deleted for being outdated -



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

1. Color differentiation from the source

Right now, games that rely on color hue for game mechanism are unplayable. (e.g. Puyo Puyo, Puzzle Bobble, S.Puzzle Fighter 2.T)
I'm going to do the following for next update:

Source -> output
----------------------------
Reds ----> mid-level green
Greens -> bright green
Blues ---> dark green



2. Dot pitch

The actual LCD used inside Game Boy had noticeable dot pitch. I already tried simulating it with artwork overlay,
but it just wouldn't look right with ugly lines that show alternating thickness.
The proper way to do this would be using "reverse" scanlines (lines that are brighter, hence, don't qualify as scanlines anymore.)
and laying them out in both horizontal and vertical orientations, forming a grid pattern.

But I don't think "reverse" scanlines are going to happen in MAME.



3. Reverse phosphor life

Instead of bright pixels lingering, Game Boy had dark pixels lingering due to slow response time of its LCD.

I don't think this is going to happen in MAME either.......

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









- Link deleted for being outdated -
Last edited by NUeda on Fri Jan 03, 2014 11:36 am, edited 29 times in total.
User avatar
Hunk_4TH
Posts: 4
Joined: Wed Feb 09, 2011 5:03 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Hunk_4TH »

Those new settings look sweet!!! But even trying those I still get those lame grids on the screen. It's driving me crazy lol. Here's my ini

http://pastebin.com/jVcVFVZL
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

Hunk_4TH,

Locate

Code: Select all

artpath                   D:/Emulators/Mame/artwork
and try changing it to

Code: Select all

artpath                   D:\Emulators\Mame\artwork
If that fails, can you try using the default ini file that is generated by mame?
You can do this by removing/renaming the mame.ini you are using
and then restarting mame and trying to play any game.

I tried your mame.ini file but couldn't recreate the square grid....
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

milligoodz,

I stopped using gamma in picture adjustments after doing a little test:

Code: Select all

gamma    2.0

power    1.0,1.0,1.0
Image

Code: Select all

gamma    1.0

power    0.5,0.5,0.5
Image


Please look at the black oval around Alex (blonde guy with red bandana).
Notice how the black pixels have shrunk while the adjacent bright pixels expanded.
I personally felt this looked better than having uniform size for white and black pixels.




Yes I agree Neo-Geo games are quite dark and need to restore brightness compared to other systems.

I didn't know System 1 and the specific games you mentioned could benefit from using lowered gamma (darkened screen),
thanks for the tip!
Last edited by NUeda on Fri Jan 03, 2014 11:44 am, edited 1 time in total.
fagin
Posts: 1654
Joined: Fri Mar 19, 2010 2:29 pm
Location: UK

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by fagin »

Those Gameboy shots look STUNNING!!!!!! It really does look real (from what I remember).

What emulation is that using?
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 »

that's non-GB roms running to look like GB screens. You can clearly see the higher resolution of those games compared to genuine Gameboy titles. But granted, it looks amazing!
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 »

Does HLSL add considerably to the video card requirements of MAME ? What about running HLSL with the above settings on an integrated Intel i5 graphics chipset (HD2000 or HD3000) ?
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 HD4000 copes admirably with it pre-bloom effect. I've not tried that machine with a newer build yet.

Any GPU from the past couple of years should be fine.
Image
User avatar
Hunk_4TH
Posts: 4
Joined: Wed Feb 09, 2011 5:03 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Hunk_4TH »

NUeda wrote:Hunk_4TH,

Locate

Code: Select all

artpath                   D:/Emulators/Mame/artwork
and try changing it to

Code: Select all

artpath                   D:\Emulators\Mame\artwork
If that fails, can you try using the default ini file that is generated by mame?
You can do this by removing/renaming the mame.ini you are using
and then restarting mame and trying to play any game.

I tried your mame.ini file but couldn't recreate the square grid....
Thanks man, I get the same problem with the new artpath. I also tried a fresh mame ini like you suggested. The grids are gone with that but the colors are faded and washed out like a crappy monitor that hasn't been repaired in 20 years lol. I'll keep tinkering with it thanks again!

*Edit* All is well now man I think the new ini did the trick after appyling the settings a few posts up. Thanks guys for your help!
User avatar
NUeda
Posts: 76
Joined: Wed May 29, 2013 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by NUeda »

Hunk_4TH,

Glad to hear the issue is ironed out, enjoy your game.




Fudoh,

I tried Core-i5 (HD2000) and MAME + HLSL. It couldn't output full 60 fps....
But vertical games (on letterboxed horizontal monitor) worked in 60 fps, which means,
lowering the resolution should lower the requirement.

Looking at how even HD4000 has issues when bloom is activated, it seems that a dedicated GPU
(even if it's a cheap one) is required for getting the most out of HLSL.

I was under the impression HLSL is fully usable with just internal graphics but I guess that isn't the case.
Last edited by NUeda on Sat Jun 15, 2013 3:26 am, edited 7 times in total.
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 »

The new Haswell CPU has HD4600, maybe that will be able to handle HLSL with Bloom
User avatar
Elaphe
Posts: 206
Joined: Sat Jan 26, 2008 4:44 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Elaphe »

The problem I've found with all hlsl settings is that the aperture pattern is not perfect. I don't know why. You can see this issue, for instance, in the green neogeo loading screen. It's close to be perfectly homegeneous, but it's not. In games this is not noticiable. The big problem comes with vertical scrolls. Try, for instance, Willow, 1st stage, the scroll from the clouds to the ground. Don't you see an ugly effect on the scanlines? My screen res es 1920x1080 and I've disabled the screen pincushion, if that matters for the configuration.

This problem doesn't happen when using an effect .png file. Actually, that's my solution (I have a custom effect with scanlines and the vertical aperture pattern) combined with SweetFX, to improve color, sharpness, bloom, etc. I'm linking a picture to show how I see Willow with this setup. I've tried not to be extreme with the settings, because too much hdr or bloom, although it may look impressive, makes you loose darker or brighter tones and details.

Another problem I have with hlsl is that it darknens the image too much. I can increase gamma in MAME.ini and that fixes the problem, but I have many custom inis with reduced gamma for games with wrong gamma, such as Outrun, Golden Axe, Violent Storm, and these would be too dark. Any solution? Isn't there a way to tweak the red, green, blue ratios to increase brightness globally?

http://www.alvarezeninternet.com/temp/e ... _color.jpg
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 »

Yeah I have noticed this vertical scrolling effect when using HLSL before but never knew what was the direct cause. I guess sweetfx is a good alternative and your picture shows good results
User avatar
Elaphe
Posts: 206
Joined: Sat Jan 26, 2008 4:44 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Elaphe »

I've just made this animated comparison to show the difference between using my custom rgb effect with nothing else, my rgb effect with sweetfx and normal settings (no tone loss either bright or dark) and the effect with stronger settings (hdr and bloom) which looks pretty cool, although some color details are lost.

http://www.alvarezeninternet.com/temp/s ... d_test.gif
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 »

You want perfect, use a CRT. :)
Image
Post Reply