MAME HLSL CRT SCANLINE EMULATION PRESETS

The place for all discussion on gaming hardware
Classicgamer
Posts: 873
Joined: Thu Sep 11, 2014 3:37 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Classicgamer »

Has anyone tried using the x and y pixel blur slider options that are in some versions of mame with HLSL?

I was thinking that, as the image on a CRT screen was made up of horizontal scanlines only, adding a little blur on the y pixel lines would help. I tested it on a few games using some already great HLSL settings which I got from this site and it made a noticable improvement. I just changed it from 0 to 0.5 and left the x blur at 0. The blur effect is small enough not to lose the detail that you want but it makes some of the undesirable effects a little less noticable.

Modern screens can seem a little too sharp to me for old games, even when using HLSL so being able to control pixel blur is a great feature. It isn't an option in all of the versions of mame that I have. It is in mame uifx 0.152 but I can find it in Mame plus 0.153, for example.

I also find that using my graphics card to scale the desktop to a 4:3 resolution before I load mame and then matching mame to the resized desktop, produces a better image. I have a Quadro 6000 in my pc and I can't remember if all consumer cards have the same level of control over image proportions but my gpu does a much better job of scaling than my monitor or projector... I have been using a cheap projector and monitor and they are horrible at scaling and this was making games look way worse.
Dogway
Posts: 16
Joined: Sun Jun 29, 2014 2:18 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Dogway »

Anyone here tested Jezze's post.fx in last MAME 0.155? I think the new changes on HLSL broke the shader, which is really pitty since there's not any other sane way to put a shader in MAME games. RetroArch is not an option since they have still a long way to go for MAME, also there's something in HLSL that smells arcade, I really like the shader.

On other not-so-important note, I never managed modded post.fx to work 100% fine for all games, an example are Zinc games, or Namco, Tekken, etc, scanlines are barely visible... my wild guess is they might be interlaced but... how do you deal with this in MAME? Most games like 80% are fine similar to the killer instinct screenshot, but some aren't.

Image Image Image Image

These are my settings:
Spoiler

Code: Select all

#
# WINDOWS VIDEO OPTIONS
#
video                     d3d
numscreens                1
window                    0
maximize                  1
keepaspect                1
unevenstretch             1
prescale                  1
waitvsync                 1
syncrefresh               1
menu                      0

#
# DIRECTDRAW-SPECIFIC OPTIONS
#
hwstretch                 1

#
# DIRECT3D-SPECIFIC OPTIONS
#
filter                    0

#
# 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           1280
hlsl_snap_height          1024
shadow_mask_alpha         0.075
shadow_mask_texture    crt_slot_mask.png
shadow_mask_x_count   -2
shadow_mask_y_count   -2
shadow_mask_usize      0.375000
shadow_mask_vsize      0.375000
curvature                 0.10
pincushion                0.2
scanline_alpha            1.0
scanline_size             1.0
scanline_height           1.00
scanline_bright_scale     1.50
scanline_bright_offset    0.60
scanline_jitter           0.05
defocus                   0.5,0.5
converge_x                0.3,0.0,-0.3
converge_y                0.0,0.3,-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.15
offset                 0.0000, 0.0000, 0.0000
scale                  0.940000, 0.950000, 0.950000
power                     0.85,0.95,0.95
floor                  0.000000, 0.000000, 0.000000
phosphor_life          0.500000, 0.500000, 0.500000

#
# NTSC POST-PROCESSING OPTIONS
#
yiq_enable                0
yiq_cc                    3.59754545
yiq_a                     0.5
yiq_b                     0.5
yiq_o                     1.570796325
yiq_p                     1.0
yiq_n                     1.0
yiq_y                     6.0
yiq_i                     1.2
yiq_q                     0.6
yiq_scan_time             52.6
yiq_phase_count           2

#
# VECTOR POST-PROCESSING OPTIONS
#
vector_length_scale       0.8
vector_length_ratio       500.0

#
# BLOOM POST-PROCESSING OPTIONS
#
vector_bloom_scale        0.3
raster_bloom_scale        0.190
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
Last edited by Dogway on Sun Oct 19, 2014 8:06 am, edited 1 time in total.
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 »

They're interlaced, scanlines aren't a thing you'd see much on those.
Image
Dogway
Posts: 16
Joined: Sun Jun 29, 2014 2:18 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Dogway »

I see, I ended up using a modified megalo preset for those games, mostly all namco starting from namcos11, zinc, model1, model2 and model3. Then a few mame random like vr, vf, vfremix...

About the post.fx issue, an user suggested me to use u-mans mod and it surprisingly fixed the problem, his mod was unrelated to my problem but it allowed me to use the megalo presets I said above, so very grateful for that, 2 issues solved with one file.
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 »

Hmmm i must admit i have used MAME in about 6 months and with the latest release half of my HLSL settings arent set correctly anymore.

Guess I'll have to start from scratch all over again
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 »

Ok have used U-mans & Cools ini and modded post.fx file as a base line and done a bit of alteration that i find is more pleasing to me, bear in mind im gaming on a 1440p screen so may have different results on a 1080p display....


Image

The ini settings....

Code: Select all

#
# CORE SCREEN OPTIONS
#
brightness                0.95
contrast                  1.1
gamma                     0.7
pause_brightness          0.65
effect                    none
#
# WINDOWS VIDEO OPTIONS
#
prescale                  2
menu                      0


#
# DIRECT3D-SPECIFIC OPTIONS
#
filter                    0

#
# DIRECT3D POST-PROCESSING OPTIONS
#
hlsl_enable               1
hlslpath                  hlsl
hlsl_prescale_x           3
hlsl_prescale_y           3
hlsl_preset               -1
hlsl_write
hlsl_snap_width           1920
hlsl_snap_height          1440
shadow_mask_alpha         0.120000
shadow_mask_texture       crt_shadow_mask.png
shadow_mask_x_count       -3
shadow_mask_y_count       -2
shadow_mask_usize         0.375
shadow_mask_vsize         0.25
curvature                 0.15
pincushion                0.0
scanline_alpha            1.2
scanline_size             1.0
scanline_height           1.0
scanline_bright_scale     1.0
scanline_bright_offset    0.0
scanline_jitter           0.0
defocus                   0.1,0.1
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.3
offset                    0.0,0.0,0.0
scale                     1.0,1.0,1.0
power                     1.0,1.0,1.0
floor                     0.02,0.02,0.02
phosphor_life             0.2,0.2,0.2

#
# BLOOM POST-PROCESSING OPTIONS
#
vector_bloom_scale        0.3
raster_bloom_scale        0.17
Dogway
Posts: 16
Joined: Sun Jun 29, 2014 2:18 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Dogway »

I found another driver with interlacing issues, gaelco3d, but unlike my previous "fix" I don't consider these appropriate for use with the megalo preset... (surf planet, radikal bikers), is there any kind of deinterlace shader for mame? I would swear these ones had scanlines on the original cabinets (small cabs)
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 »

MAME can happily deinterlace them itself, simply disable scanlines :) I run interlaced stuff in its progressive equivalent, rather than worry about simulating the flicker.
Image
Dogway
Posts: 16
Joined: Sun Jun 29, 2014 2:18 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Dogway »

So am I good to assume that these games didn't show scanlines ever in the cabs?
If so what would be a good HLSL preset? There's one from u-man's pack but it shows heavy moire and generally not very pleasing. It simply looks like interlaced games are big pain to use shaders with...

edit: I'm kinda sensing the answer... well rethinking your words, "disable the scanlines" (was reading -disable shader-), and leave everything else as is. Hopefully I get a good CRT feel even without them. Let me test.

edit2: no luck, simply disabled scanlines and I get some very simple yet mangled scanlines, which flicker (not visible on screenshot) and make huge moire bands all over the screen, unplayable. I post settings as well for the gaelco3d preset sans scanlines:


Image

Settings :
Spoiler

Code: Select all

#
# WINDOWS VIDEO OPTIONS
#
video                     d3d
numscreens                1
window                    0
maximize                  1
keepaspect                1
unevenstretch             1
prescale                  1
waitvsync                 0
syncrefresh               0
menu                      0

#
# DIRECT3D-SPECIFIC OPTIONS
#
filter                    0

#
# 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           1280
hlsl_snap_height          1024

curvature                 0.150000
pincushion                0.150000

defocus                   0.500000,0.500000
converge_x                0.000000,0.000000,0.500000
converge_y                0.250000,0.000000,0.000000
radial_converge_x         0.000000,0.000000,0.000000
radial_converge_y         0.000000,0.000000,0.000000
red_ratio                 1.050000,0.000000,0.100000
grn_ratio                 -0.100000,1.000000,0.250000
blu_ratio                 -0.250000,0.250000,1.250000
saturation                1.150000
offset                    0.015000,0.015000,0.015000
scale                     0.900000,0.950000,0.950000
power                     1.300000,1.100000,1.000000
floor                     0.030000,0.030000,0.030000
phosphor_life             0.500000,0.500000,0.500000

#
# NTSC POST-PROCESSING OPTIONS
#
yiq_enable                0
yiq_cc                    3.597545
yiq_a                     0.500000
yiq_b                     0.500000
yiq_o                     0.000000
yiq_p                     1.000000
yiq_n                     1.000000
yiq_y                     6.000000
yiq_i                     1.200000
yiq_q                     0.600000
yiq_scan_time             52.600000
yiq_phase_count           2

#
# VECTOR POST-PROCESSING OPTIONS
#
vector_length_scale       0.800000
vector_length_ratio       500.000000

#
# BLOOM POST-PROCESSING OPTIONS
#
vector_bloom_scale        0.300000
raster_bloom_scale        0.190000
bloom_lvl0_weight         1.000000
bloom_lvl1_weight         0.320000
bloom_lvl2_weight         0.280000
bloom_lvl3_weight         0.240000
bloom_lvl4_weight         0.200000
bloom_lvl5_weight         0.160000
bloom_lvl6_weight         0.120000
bloom_lvl7_weight         0.080000
bloom_lvl8_weight         0.040000
bloom_lvl9_weight         0.020000
bloom_lvl10_weight        0.010000
Dogway
Posts: 16
Joined: Sun Jun 29, 2014 2:18 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Dogway »

Never mind, fixed:

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 »

Not bad at all :)

Simulating an interlaced display isn't something I've seen any drive for, it's typically deinterlacing that's the objective - which is what MAME will do natively. Looks way better.
Image
Dogway
Posts: 16
Joined: Sun Jun 29, 2014 2:18 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Dogway »

yeah, there's still some odd fine scanline blending... but it doesn't bother me as much.

I've been trying these days to also apply the megalo bezel without success... I wonder what I might be doing wrong. The Bezel overlay has some good vignetting and circular pattern I would like to use.

Inside the artwork path there is a "Megalo" folder containing default.lay and megalo.png.

This is the default.lay:

Code: Select all

<mamelayout version="2">
	<element name="bezel">
		<image file="megalo.png" />
	</element>
	<view name="Upright_Artwork">
		<screen index="0">
			<bounds x="526" y="288" width="1280" height="720" />
		</screen>
		<bezel element="bezel">
			<bounds x="0" y="0" width="2492" height="1402" />
		</bezel>
	</view>
</mamelayout>
And these are my settings:

Code: Select all

mame64.exe plsmaswd -hlsl_enable  -video d3d -artwork_crop -use_bezels -rompath "E:\ROMS\PCB Zinc"
Spoiler

Code: Select all

artpath                   artwork/Megalo

artwork_crop              1
use_backdrops             1
use_overlays              1
use_bezels                1
use_cpanels               1
use_marquees              1

video                     d3d
numscreens                1
window                    0
maximize                  1
keepaspect                1
unevenstretch             1
waitvsync                 1
syncrefresh               0
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 »

Change the folder name to plsmaswd, and the artpath just to artwork
Image
Dogway
Posts: 16
Joined: Sun Jun 29, 2014 2:18 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Dogway »

It worked! how strange, I need to create a folder for each of the games...

I'm battling to configure the lay options, it looks so counterintuitive... it seems MAME wouldn't resize the bezel, so I had to by myself, and along the way I cropped the bezel. Then I wrote down some logical values, almost perfect except the bottom and top megalo framings get hidden outside screen... I'm so confused (currently using my monitor as 1280x720)

Image

Code: Select all

<mamelayout version="2">
	<element name="bezel">
		<image file="megalo.png" />
	</element>
	<view name="Upright_Artwork">
		<screen index="0">
			<bounds x="183" y="14" width="914" height="685" />
		</screen>
		<bezel element="bezel">
			<bounds x="0" y="0" width="1280" height="720" />
		</bezel>
	</view>
</mamelayout>

edit: I disabled autocrop and it's fine now, although... I would have like to use the original huge bezel and do all the tweaking (crop+resize) through mame, making it also display resolution independent.

edit2: completely removed the thin "scanlines", I had to set scanlines_alpha to 0 too. Maybe on a 1080p display they look fine, but for the time being...
justice99
Posts: 91
Joined: Sat May 12, 2012 2:42 pm
Location: France

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by justice99 »

Dogway wrote:Never mind, fixed:

Image
What's this game? Rom or CHD ?

Im using Mame 0.115 and Im totally lost with the old HLSL and new one. Should I stick with a .ini file or I need jezze stuff?
Can anyone send me files to get a good HLSL? I will play with it buy I need something to start with.

Thanks in advance.
User avatar
blizzz
Posts: 1150
Joined: Fri Sep 16, 2011 6:19 pm
Location: Germany
Contact:

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by blizzz »

Is there a way to get integer scaling in version 0.156? The help mentions "-unevenstretch", but that doesn't seem to make any difference.

Soukyugurentai seems to work in 0.15x, but it's stretched to fullscreen with some ugly moire effects. In Mame 0.14x / Shmupsmame there are no moire problems, but the game is missing sprites.

Edit: I give up. I'll finally buy a Saturn for christmas. :mrgreen:
Edit 2: Bought one :D
justice99
Posts: 91
Joined: Sat May 12, 2012 2:42 pm
Location: France

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by justice99 »

blizzz wrote:Is there a way to get integer scaling in version 0.156? The help mentions "-unevenstretch", but that doesn't seem to make any difference.
Yes you can, by using Scanlines75x2.png in Visual Effects. it works with DirectDraw...
User avatar
Pasky
Posts: 698
Joined: Mon Oct 21, 2013 3:58 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Pasky »

Lettuce, would you mind just posting your entire ini? Everytime I use your settings I get nothing like your screen shot and it's extremely blurry or way too much bloom.
User avatar
butman
Posts: 1
Joined: Mon Dec 22, 2014 6:52 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by butman »

Nice thread guys. It's the most activeHLSL thread related that i found. Hope it maintain alive.

Read the entire thread and finally the lastest config from cools worked. I'm from the group of people that like to play on big screen so i have connected a laptop with a intel 4000 video card, so i needed a mid power hlsl config.

Question: It is possible to change the settings from scanlines to something like more crt monitor in HLSL?

Example shot:

Image

*The shot is from a crt shader applied on Retroarch. I think its looks amazing!
User avatar
1up
Posts: 1105
Joined: Thu May 25, 2006 7:50 am
Location: Denmark

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by 1up »

I tried lettuce's settings and they work pretty great on a 1080p display.

I have some odd trouble with Neo Geo games though, I get these black overlay bars on each side? And only in Neo Geo games?
Image

All artwork options are turned off, and changing pixel aspect ratio doesn't remove it?
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 get these black overlay bars on each side?
same thing as on a real MVS setup.
User avatar
1up
Posts: 1105
Joined: Thu May 25, 2006 7:50 am
Location: Denmark

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by 1up »

Just looked at an old video a did years ago on my Sega Astro City, and you're right? I've never noticed that on the real hardware :lol:
BONKERS
Posts: 418
Joined: Thu Dec 11, 2014 10:41 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by BONKERS »

1up wrote:Just looked at an old video a did years ago on my Sega Astro City, and you're right? I've never noticed that on the real hardware :lol:
Probably because of overscan
Lamprey
Posts: 17
Joined: Wed Feb 18, 2015 11:05 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Lamprey »

butman wrote:Nice thread guys. It's the most activeHLSL thread related that i found. Hope it maintain alive.

Read the entire thread and finally the lastest config from cools worked. I'm from the group of people that like to play on big screen so i have connected a laptop with a intel 4000 video card, so i needed a mid power hlsl config.

Question: It is possible to change the settings from scanlines to something like more crt monitor in HLSL?

Example shot:

<snip>

*The shot is from a crt shader applied on Retroarch. I think its looks amazing!
Have you checked out any GLSL shaders? A lot of people like Timothy Lottes' CRT Shader for SDLMame.

Here is a link to it over at Mameworld:
http://www.mameworld.info/ubbthreads/sh ... ber=332320
User avatar
gStAv
Posts: 1
Joined: Sat Feb 21, 2015 10:26 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by gStAv »

Hi guys!

Great thread you got going on here! :P
MAME looks so good compared to my previous cab setup on .146 without the HLSL ini's.

Just have one problem after the switch over to MAMEUIFX.

Everyting works in HLSL as far as I can see, except the 'pincusion' settings which do nothing,
even when set to max.... screen curvature works though.

Have I missed something here? Thanks for any pointer!

Cheers

/Gustav
"one credit to rule them all"
creamygarlicdip
Posts: 67
Joined: Wed Oct 15, 2014 8:32 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by creamygarlicdip »

Terrrific work with this stuff, I've had fun trying the settings you guys have.

Also I'm a fan of the imperfections introduced in the blargg ntsc shader that was made for console emulators. Is there a setting that can help mimic that in mame hlsl? particularly i like the s-video preset he made:

Image
Mokum
Posts: 11
Joined: Sun Jul 24, 2011 7:37 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Mokum »

@cools I've just used your HLSL cfg and it rocks. I've got some minor issues tho, issues I've been experiencing with other HLSL cfg's too and even tho I've browsed tons of sites I cannot figure out why this is happening.

Going into details. I had videos issues with both Green Beret and Neo Turf Masters, the problem has been fixed downloading new roms from a different site. First question: why do different roms of the same game act differently? Second: I still have issues with Toki and Metal Slug both having a red which is too bright and a darker palette all around. Again: why such a difference with every other title I run? I guess I've got to fix both in game, am I correct? Last one: Armed Police Batrider act differently from other vertical shooters (ie Mushihime-Sama) and is as wide as my monitor. I tried to mess with the in game options but with no luck. Why is it so?

I bet some of my questions aren't pretty much HLSL related, and I apologize in advance, but if you could help me out that would gretely appreciated.
Mokum
Posts: 11
Joined: Sun Jul 24, 2011 7:37 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Mokum »

Ok, I've finally managed to figure out what was wrong... The ini file simply wasn't applied to each and every game in my list. In fact a simple copy/past of cool's ini files over those of the games I have just fixed my issues brilliantly.
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 »

It should work with all, however if you already had ini files there you'd been experimenting with they might interfere.
Image
User avatar
Josh128
Posts: 2144
Joined: Thu Jan 16, 2014 9:01 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Josh128 »

Has anyone gotten HLSL scanlines working properly on a 768p set thus far? Thus far, the only emulator Ive come across where I can get perfect full screen scanlines is Kega Fusion, which does an even 3x scale to 720 vertical lines, applies a scanline to every 3rd line of TV pixels while using 1st and 2nd lines of TV pixels together for every game image line, and displays it unstretched, in a 1024x768 frame.

Ive never used HLSL Mame, but it looks highly configurable, surely it could be configured to work like the above for many games?
Post Reply