Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Anyone adjusting HLSL on a per game basis?  (Read 8819 times)

0 Members and 1 Guest are viewing this topic.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:12:23 am
  • ...
Anyone adjusting HLSL on a per game basis?
« on: November 01, 2013, 09:47:58 am »
EDIT: Spreadsheet I'm making to copy and rename an .ini file with correct HLSL settings for all games that use that resolution.
https://docs.google.com/spreadsheet/ccc?key=0Aq37CSO6oe1fdE9MRG54MG1sZHQtY1hvTzlNVHFLbUE&usp=sharing#gid=9



Originally I wasn't going to bother with HLSL on my current build, then I tried some settings found posted online that with a little tweaking, made Ms Pacman look soooo much closer to the real machine I used to have.  (I did reduce phosphor life to .05 to eliminate blur)
The big factors that didn't sink in when I messed with it before were using a high resolution(1080) and prescale(6).

The vertical classics look great, but Frogger and Popeye slowed to 50% speed with the prescale set to 6.  Lowering it fixes the issue, but it doesn't look nearly as good.   At the start of this, I thought I'd just apply the settings globally in mame.ini, then turn off HLSL in the newer 3D games' individual ini.
Having random classics slow down blew a hole in that plan.

Mortal Kombat runs full speed, but doesn't look that great with these settings, and as expected none of the 3D games will run at full speed with HLSL enabled.

So I created an .ini file with settings for the classics, copied it many many times, and renamed them all to match the games in my classics gamelist.
None of the other games have HLSL enabled at this point.  I'm planning to do NEO GEO games next since they'd all use the same monitor. 

Is there some better way to go about this?
(buy a newer card than the Nvidia 9800GT that I'm using?)

Anyone bothering to match the shadow mask count for each game to the original monitor resolution?


EDIT: found this blog post with what the settings do put into layman's terms: http://gamingnos.blogspot.com/2011/10/quick-start-mame-hlsl-filter-guide-up.html
It made the prescale setting make more sense to me.

Ond's post here is also very helpful in explaining how this stuff works:
http://forum.arcadecontrols.com/index.php/topic,133382.msg1373471.html#msg1373471

« Last Edit: November 09, 2013, 01:51:14 pm by BadMouth »

lcmgadgets

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 471
  • Last login:July 31, 2023, 01:46:12 pm
  • Can u guess what game this image is from?
Re: Anyone adjusting HLSL on a per game basis?
« Reply #1 on: November 01, 2013, 10:37:50 am »
...I didn't even know what HLSL was, until I read part of the wiki. Now, I have a vague inkling.  :dunno
"Godzilla is a warning. A warning to each and every one of us. When mankind falls into conflict with nature, monsters are born."
Professor Hayashida

404

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1019
  • Last login:August 04, 2015, 10:19:10 pm
Re: Anyone adjusting HLSL on a per game basis?
« Reply #2 on: November 01, 2013, 11:02:58 am »
Originally I wasn't going to bother with HLSL on my current build, then I tried some settings found posted online that with a little tweaking, made Ms Pacman look soooo much closer to the real machine I used to have. 
The big factors that didn't sink in when I messed with it before were using a high resolution(1080) and prescale(6).

The vertical classics look great, but Frogger and Popeye slowed to 50% speed with the prescale set to 6.  Lowering it fixes the issue, but it doesn't look nearly as good.   At the start of this, I thought I'd just apply the settings globally in mame.ini, then turn off HLSL in the newer 3D games' individual ini.
Having random classics slow down blew a hole in that plan.

Mortal Kombat runs full speed, but doesn't look that great with these settings, and as expected none of the 3D games will run at full speed with HLSL enabled.

So I created an .ini file with settings for the classics, copied it many many times, and renamed them all to match the games in my classics gamelist.
None of the other games have HLSL enabled at this point.  I'm planning to do NEO GEO games next since they'd all use the same monitor. 

Is there some better way to go about this?
(buy a newer card than the Nvidia 9800GT that I'm using?)

Anyone bothering to match the shadow mask count for each game to the original monitor resolution?

strange. that card shouldn't miss a beat with HLSL. 

Haze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1296
  • Last login:October 04, 2023, 08:30:02 am
  • I want to build my own arcade controls!
    • MAME Development Blog
Re: Anyone adjusting HLSL on a per game basis?
« Reply #3 on: November 01, 2013, 11:25:21 am »
afaik it's the prescale that kills you.. a prescale of 6 is very high, and means the HLSL shaders have to process a lot more data.

yotsuya

  • Trade Count: (+21)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19960
  • Last login:July 17, 2025, 10:00:30 pm
  • 2014 UCA Winner, 2014, 2015, 2016 ZapCon Winner
    • forum.arcadecontrols.com/index.php/topic,137636.msg1420628.html
Re: Anyone adjusting HLSL on a per game basis?
« Reply #4 on: November 01, 2013, 11:25:50 am »
I just throw a MiniSLG in mine and not worry about HLSL.
***Build what you dig, bro. Build what you dig.***

thatpurplestuff

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 670
  • Last login:May 10, 2025, 02:37:15 pm
Re: Anyone adjusting HLSL on a per game basis?
« Reply #5 on: November 01, 2013, 11:43:33 am »
...I didn't even know what HLSL was, until I read part of the wiki. Now, I have a vague inkling.  :dunno



I was in the same boat a few months ago until I googled it and found some youtube videos.  This Final Fight vid gives an idea as to what the capabilities are... basically offers a cool CRT simulation for flatscreens.

So once again, we find that evil of the past seeps into the present like salad dressing through cheap wax paper, mixing memory and desire.

lcmgadgets

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 471
  • Last login:July 31, 2023, 01:46:12 pm
  • Can u guess what game this image is from?
Re: Anyone adjusting HLSL on a per game basis?
« Reply #6 on: November 01, 2013, 01:47:37 pm »
Wow. Thanks for that! What a difference!
"Godzilla is a warning. A warning to each and every one of us. When mankind falls into conflict with nature, monsters are born."
Professor Hayashida

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:12:23 am
  • ...
Re: Anyone adjusting HLSL on a per game basis?
« Reply #7 on: November 01, 2013, 04:55:14 pm »
The more I get into this, the more I realize that you really do need to do need to have different settings for each original resolution.
The lines on the screen really need to line up with the edges of the pixels for it to look right.

B2K24

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 216
  • Last login:June 10, 2025, 10:17:56 am
Re: Anyone adjusting HLSL on a per game basis?
« Reply #8 on: November 01, 2013, 09:40:21 pm »
I'm currently using these settings. Also, THIS thread is an interesting that has a batch ini creator.

Code: [Select]
hlsl_enable               1
hlslpath                  hlsl
hlsl_ini_read             0
hlsl_ini_write            0
hlslini                   %g
hlsl_prescale_x           6
hlsl_prescale_y           6
hlsl_preset               -1
hlsl_write               
hlsl_snap_width           1024
hlsl_snap_height          768
shadow_mask_alpha         0.1
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.0
pincushion                0.02
scanline_alpha            1.0
scanline_size             1.0
scanline_height           1.0
scanline_bright_scale     1.0
scanline_bright_offset    0.0
scanline_jitter           0.05
defocus                   0.0,0.0
converge_x                0.2,0.0,0.0
converge_y                0.0,0.0,0.0
radial_converge_x         0.2,0.0,0.0
radial_converge_y         0.0,0.0,0.0
red_ratio                 0.85,0.15,0.0
grn_ratio                 -0.05,1.05,0.0
blu_ratio                 -0.025,-0.025,1.05
saturation                1.0
offset                    -0.15,-0.16,-0.16
scale                     1.15,1.16,1.16
power                     1.1,0.95,0.8
floor                     0.0,0.0,0.0
phosphor_life             0.0,0.0,0.0
 
#
# NTSC POST-PROCESSING OPTIONS
#
yiq_enable                0
yiq_cc                    3.59754545
yiq_a                     0.5
yiq_b                     0.5
yiq_o                     0.0
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.350
raster_bloom_scale        0.2
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

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:12:23 am
  • ...
Re: Anyone adjusting HLSL on a per game basis?
« Reply #9 on: November 07, 2013, 03:51:13 pm »
I'm currently using these settings. Also, THIS thread is an interesting that has a batch ini creator.

Good info in that thread.  I'm going about creating the ini files in a different way though.

Using an early beta version of the MAWS replacement that ids is working on (http://forum.arcadecontrols.com/index.php/topic,129498.0.html), I'm able to get a list of all games of a particular resolution with a couple clicks.  I copy and paste that list into a google spreadsheet and manipulate it into a batch file that will copy and rename an ini file containing the HLSL settings for that particular resolution.  (just copy and paste column D to notepad and save as a batch file)
https://docs.google.com/spreadsheet/ccc?key=0Aq37CSO6oe1fdE9MRG54MG1sZHQtY1hvTzlNVHFLbUE&usp=sharing

This is still a work in progress, but the whole process of making a batch file for a given resolution takes less than a minute.
I'll probably update the spreadsheet tonight with more resolutions while watching football.

On the 640x480 resolution, I sorted by genre first and deleted the casino games.
I'll be switching over to a different xml that has nearly all of the gambling and adult games removed, so we won't be cluttering it up with those.

B2K24

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 216
  • Last login:June 10, 2025, 10:17:56 am
Re: Anyone adjusting HLSL on a per game basis?
« Reply #10 on: November 08, 2013, 02:51:07 am »
When your finished with your work if you could zip up your ini folder and upload it somewhere or attach it here that would be awesome :)

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:12:23 am
  • ...
Re: Anyone adjusting HLSL on a per game basis?
« Reply #11 on: November 08, 2013, 09:59:20 pm »
When your finished with your work if you could zip up your ini folder and upload it somewhere or attach it here that would be awesome :)

Yeah, but even changing the overall brightness in MAME makes a huge difference in how much the scanlines show up, so what looks good on my monitory might not look good on yours.  When I'm done though, I'll release everything including the batch files to create the ini files.  A half dozen resolutions cover most of the games.
The 640x480 ones are a PITA and it might take a while to sort through them.  They are listed at that resolution because that was the resolution of the monitor, but intro screens and games ran at different resolutions.

Did some field research today.  ;D
All pics attached are NOT HLSL.  They were taken of real arcade games on-site.
I thought everyone's scanlines looked to dark to me, so I wanted a reference.

The wide bands that are darker are an artifact from taking the pic.  the lighter bands are more true to the original appearance.
« Last Edit: November 08, 2013, 10:11:59 pm by BadMouth »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:12:23 am
  • ...
Re: Anyone adjusting HLSL on a per game basis?
« Reply #12 on: November 08, 2013, 10:02:20 pm »
moar real scanline pics

With HLSL pincushion, I don't like how the curve of the edges of the monitor are jaggy and the corners aren't rounded enough.
Has anyone made up .lay files with a shroud?
« Last Edit: November 08, 2013, 10:11:41 pm by BadMouth »

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9671
  • Last login:Today at 10:48:01 am
  • Designated spam hunter
Re: Anyone adjusting HLSL on a per game basis?
« Reply #13 on: November 09, 2013, 12:30:36 am »
Has anyone made up .lay files with a shroud?

Have you looked at MameLayPlus?


Scott

lettuce

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1900
  • Last login:December 31, 2021, 01:46:10 pm
  • Make It So!
Re: Anyone adjusting HLSL on a per game basis?
« Reply #14 on: November 09, 2013, 10:43:54 am »



I was in the same boat a few months ago until I googled it and found some youtube videos.  This Final Fight vid gives an idea as to what the capabilities are... basically offers a cool CRT simulation for flatscreens.

Ahh, thats my video, ill have to do an update in better quality with my new HLSL, prescale.fx and post.fx mod

Heres the setting i currently use...

« Last Edit: November 09, 2013, 10:46:18 am by lettuce »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:12:23 am
  • ...
Re: Anyone adjusting HLSL on a per game basis?
« Reply #15 on: November 09, 2013, 12:11:55 pm »
Has anyone made up .lay files with a shroud?

Have you looked at MameLayPlus?


Scott

I will check it out.  I thought it just put marquees on the sides when using a widescreen monitor.


B2K24, I'm not sure my settings are going to translate to very may other setups.
I originally set the shadowmask to the same dimensions as the original resolution per everything I've come across online.....and it looked ok, but looked wrong to me.

The mesh of the shadowmask looked too big IMO.  This is one of the reasons that I wanted to go photograph real machines.
It's doubtful that the monitor in the ms pacman machine above was original, but it looks like the power pill in the pic is divided into 13 sections vertically.
With the shadow mask set to the original resolution, I only get 9 sections.  So following the math, I change the shadow mask to 414x322.

It looks right to me now, but the way I arrived at it bothers me.  I was hoping to find settings that "are correct" based on original resolutions and maybe have to adjust for it being stretched to 1080.
I'm running this on a 27" rotated monitor, so the rendered screen area is around 22".
Not rotating the game and having a smaller image makes these settings look like complete crap.

Anyone else with a big monitor want to give them a try and let me know what you think?
(the scanlines are probably light for most people's taste, but these are only for the 288x224 games)
I've been testing with ms pacman

Code: [Select]
# DIRECT3D POST-PROCESSING OPTIONS
#
hlsl_enable               1
hlslpath                  hlsl
hlsl_ini_read             0
hlsl_ini_write            0
hlslini                   %g
hlsl_prescale_x           4
hlsl_prescale_y           4
hlsl_preset               -1
hlsl_write               
hlsl_snap_width           2048
hlsl_snap_height          1536
shadow_mask_alpha         0.300000
shadow_mask_texture       aperture.png
shadow_mask_x_count       414
shadow_mask_y_count       322
shadow_mask_usize         0.093750
shadow_mask_vsize         0.093750
curvature                 0.000000
pincushion                0.025000
scanline_alpha            0.200000
scanline_size             0.830000
scanline_height           0.500000
scanline_bright_scale     1.000000
scanline_bright_offset    1.000000
scanline_jitter           0.000000
defocus                   0.900000,0.900000
converge_x                0.200000,0.000000,0.000000
converge_y                0.000000,0.000000,0.000000
radial_converge_x         0.200000,0.000000,0.000000
radial_converge_y         0.000000,0.000000,0.000000
red_ratio                 1.000000,0.000000,0.000000
grn_ratio                 0.000000,1.000000,0.000000
blu_ratio                 0.000000,0.000000,1.000000
saturation                1.050000
offset                    0.000000,0.000000,0.000000
scale                     1.020000,1.020000,1.020000
power                     1.300000,1.300000,1.300000
floor                     0.020000,0.020000,0.020000
phosphor_life             0.3000000,0.3000000,0.3000000

« Last Edit: November 09, 2013, 12:14:34 pm by BadMouth »

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9671
  • Last login:Today at 10:48:01 am
  • Designated spam hunter
Re: Anyone adjusting HLSL on a per game basis?
« Reply #16 on: November 09, 2013, 01:32:37 pm »
Has anyone made up .lay files with a shroud?
Have you looked at MameLayPlus?
I will check it out.  I thought it just put marquees on the sides when using a widescreen monitor.
For horizontal WS setups it has cocktail layouts and for vertical WS setups, it has the marquee (1024 pixels wide) at the top, a bezel around the monitor area, and instruction card. (default layout images attached)


Scott
« Last Edit: November 09, 2013, 01:40:03 pm by PL1 »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:12:23 am
  • ...
Re: Anyone adjusting HLSL on a per game basis?
« Reply #17 on: November 09, 2013, 01:37:58 pm »
adjusted sf2 based on the above pics (mostly the damage meter)
I'm very happy with the results.
Applied to all games of the same resolution.

settings are attached as a txt file



THESE PICS ARE HLSL
« Last Edit: November 09, 2013, 01:42:46 pm by BadMouth »

McHale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:June 27, 2023, 03:42:17 am
  • For Duty and Humanity!
Re: Anyone adjusting HLSL on a per game basis?
« Reply #18 on: November 09, 2013, 03:34:57 pm »
I'm only using HLSL for vector games.  But I do set them on a per game basis.

ABACABB

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 224
  • Last login:August 26, 2023, 12:37:07 pm
Re: Anyone adjusting HLSL on a per game basis?
« Reply #19 on: November 10, 2013, 12:10:32 pm »
Hey BadMouth, I USED to use HLSL with my previous flatscreen.  Once I scored the arcade monitor from you there's no looking back, for now.  Agree HLSL does look pretty good on a flatscreen but the real thing is unbeatable IMHO. 

I'm guessing this is for your NEO GEO slim cab where a CRT would never fit anyways?  Cool idea.  Hope it works out for you.