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: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---  (Read 26285 times)

0 Members and 1 Guest are viewing this topic.

bulbousbeard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 522
  • Last login:August 25, 2015, 11:58:25 pm
  • I want to build my own arcade controls!
Go into prescale.fx and find this:

sampler DiffuseSampler = sampler_state
{
   Texture   = <Diffuse>;
   MipFilter = LINEAR;
   MinFilter = LINEAR;
   MagFilter = LINEAR;

That's why MAME's HLSL filter always looked like blurry dogshit. It was doing linear filtering on everything before you even got to adjusting the settings.

Just change it to this to get rid of the ---smurfy--- N64 filtering, and magically, HLSL will look sharp like a REAL arcade monitor, and you can actually use the defocus settings now to find the sweet spot between PC and arcade sharpness.

   Texture   = <Diffuse>;
   MipFilter = NONE;
   MinFilter = NONE;
   MagFilter = NONE;

If you want to see before and after shots using the same settings, here you go.

Before:


After:


See? NOT blurry crap anymore. Actually sharp. Like a real arcade monitor. Yeah. Yeaaah! Like an ACTUAL arcade monitor is crisp and sharp.

http://memegenerator.net/instance/42680609
« Last Edit: November 03, 2013, 07:49:21 pm by bulbousbeard »

machyavel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 67
  • Last login:December 25, 2016, 10:23:52 am
Very nice and much useful tweak!

bulbousbeard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 522
  • Last login:August 25, 2015, 11:58:25 pm
  • I want to build my own arcade controls!
More glorious screenshots:
















B2K24

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 216
  • Last login:May 10, 2023, 09:33:05 pm
@bulbousbeard: can you pastebin or put your HLSL settings from mame.ini here for a test please?

mcilrain

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:February 09, 2014, 06:45:41 pm
  • I want to build my own arcade controls!
Thank you!

I was trying to get hlsl shaders to make a high-resolution CRT (PC) monitor look like a PVM but gave up due to being unable to get rid of the blur.

I hope that this becomes the default.

bulbousbeard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 522
  • Last login:August 25, 2015, 11:58:25 pm
  • I want to build my own arcade controls!
@bulbousbeard: can you pastebin or put your HLSL settings from mame.ini here for a test please?

The settings I'm using now:
http://pastebin.com/zQZysq4y

Note that I'm not using the standard aperture.png.

B2K24

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 216
  • Last login:May 10, 2023, 09:33:05 pm
Thanks for posting those. Why have you set your prescale so high at 8?

I was told 3 or 4 is good enough even at 1920X1080 display.

bulbousbeard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 522
  • Last login:August 25, 2015, 11:58:25 pm
  • I want to build my own arcade controls!
Thanks for posting those. Why have you set your prescale so high at 8?

I was told 3 or 4 is good enough even at 1920X1080 display.

I run at 2560x1600 on one of my computers.

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7411
  • Last login:March 14, 2024, 05:26:05 am
  • Quote me with care
Hi bulbousbeard,

I'd say the average arcade monitor is somewhere between your "before" and "after" pictures. I find your results after the patch a bit too sharp, even if arcade monitors are not simply blurry as some pleople think: they do blend colors along the scanline to some extent.

This is my current HLSL setup (GM 0.149), notice the shades on Zandief legs, for instance:



Code: [Select]
#
# DIRECT3D POST-PROCESSING OPTIONS
#
hlsl_enable               1
hlslpath                  hlsl
hlsl_ini_read             0
hlsl_ini_write            0
hlslini                   %g
hlsl_prescale_x           0
hlsl_prescale_y           0
hlsl_preset               -1
hlsl_write               
hlsl_snap_width           1024
hlsl_snap_height          768
shadow_mask_alpha         0.15
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.7
scanline_bright_offset    0.0
scanline_jitter           0.0
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.1,1.1,0.0
blu_ratio                 -0.075,0.0,1.075
saturation                1.0
offset                    -0.15,-0.18,-0.18
scale                     1.15,1.18,1.18
power                     1.1,0.9,0.7
floor                     0.01,0.0,0.01
phosphor_life             0.0,0.0,0.0

PS: Note this runs at 30% on my system, so it's no where near being playable, it's just to show that normal hlsl is not necessarily blurry.

EDIT: Colors here are much brighter than on the picture, it seems the site converted it from .png to .jpg and the colors are screwed.
« Last Edit: November 04, 2013, 08:25:58 am by Calamity »
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

B2K24

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 216
  • Last login:May 10, 2023, 09:33:05 pm
Thank You Calamity for sharing your settings  ;D

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7411
  • Last login:March 14, 2024, 05:26:05 am
  • Quote me with care
Thank You Calamity for sharing your settings  ;D


To be fair I grabbed those settings somewhere ;)
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

bulbousbeard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 522
  • Last login:August 25, 2015, 11:58:25 pm
  • I want to build my own arcade controls!
What's missing in Calamity's screenshot, though, is the crispness of a real arcade monitor. It's impossible to get it with the linear filter.

The thing about this change is that it means you can actually use the defocus option now (you couldn't before because it would be way too blurry).

I agree about the sharpness. I had defocus on 0, and with no linearing filtering, it is a bit too sharp. If you set defocus at like 1.0 or 1.5, it's right in between. It still has the crispness of a CRT, but there's some bleed.
« Last Edit: November 04, 2013, 03:15:55 pm by bulbousbeard »

bulbousbeard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 522
  • Last login:August 25, 2015, 11:58:25 pm
  • I want to build my own arcade controls!
Here's what I'm talking about. Here are Calamity's HLSL settings with the modification and a defocus setting of 1.5.



See how you're still getting the subtle blur effect yet maintaining the crispness of the image?

The image will simply never be crisp with linear filtering applied to it first.

jdubs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 61
  • Last login:January 03, 2018, 09:06:27 am
REALLY good tips on accurate HLSL setup.

http://shmups.system11.org/viewtopic.php?f=6&t=45026

-Jim

SMMM

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 21
  • Last login:October 10, 2020, 09:19:13 pm
Is HLSL applicable when used on a real 15khz arcade monitor, or is it something that's only applied on a modern monitor?

cmoses

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 718
  • Last login:July 27, 2023, 05:19:00 pm
Very interesting I will have to give these a try.

cools

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 645
  • Last login:March 11, 2024, 02:59:06 pm
  • Arcade Otaku Sysadmin
    • Arcade Otaku
Here's what I'm talking about. Here are Calamity's HLSL settings with the modification and a defocus setting of 1.5.

This is by far the closest to an high-end arcade CRT in this thread. The ones in the beginning are too sharp, and the original Calamity ones are too soft - not sure what on earth was going on with your own "LINEAR" settings as those were atrocious.

adder

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 640
  • Last login:February 04, 2021, 10:51:51 am
  • Location: Easy St.
Is HLSL applicable when used on a real 15khz arcade monitor, or is it something that's only applied on a modern monitor?

hlsl was designed in mind to attempt to make the more modern types of monitors (eg. lcd) look more like a real (crt) arcade monitor

bulbousbeard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 522
  • Last login:August 25, 2015, 11:58:25 pm
  • I want to build my own arcade controls!
Here's what I'm talking about. Here are Calamity's HLSL settings with the modification and a defocus setting of 1.5.

This is by far the closest to an high-end arcade CRT in this thread. The ones in the beginning are too sharp, and the original Calamity ones are too soft - not sure what on earth was going on with your own "LINEAR" settings as those were atrocious.

Hi Cools,

It's because the screenshot with the default prescale.fx had defocus 1.5 set. You basically can't use defocus at all with linear filtering, because you're getting double blurring.

By removing the linear filter, you can actually use the defocus setting to decide how blurry or sharp you want the image to be.

isamu

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 807
  • Last login:March 18, 2024, 02:38:32 am
  • I'm a llama!
How do you achieve these results using SweetFX instead of HLSL?

cmoses

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 718
  • Last login:July 27, 2023, 05:19:00 pm
@bulbousbeard: can you pastebin or put your HLSL settings from mame.ini here for a test please?

The settings I'm using now:
http://pastebin.com/zQZysq4y

Note that I'm not using the standard aperture.png.

Bulbousbeard,

Did the first post get edited? It looks to be missing some information.

Also what aperture.png are you using?

Thanks


Sent from my iPad Mini using Tapatalk HD

mcilrain

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:February 09, 2014, 06:45:41 pm
  • I want to build my own arcade controls!
What is it with emulator developers and blindness? None of them seem to know how a CRT is supposed to look.                   

mmg1design

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14
  • Last login:July 30, 2016, 03:22:09 pm
  • I want to build my own arcade controls!
    • My Website
Thanks! these changes make a huge difference.

Instruction Cards for Street fighter games and other fighting genre. Download Here

Boulotaur2024

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 9
  • Last login:January 26, 2014, 03:50:42 am
  • I want to build my own arcade controls!
More glorious screenshots:

















This looks absolutely fantastic mate.
Can you confirm the HLSL settings you posted here reflect these screenshots ?

isamu

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 807
  • Last login:March 18, 2024, 02:38:32 am
  • I'm a llama!
Boulataur since you're here, I have a couple of questions re SweetFX....has there been any changes/improvements to the CRT shader in the latest version of SWFX? Are we able to achieve scanline effects similar to MAME's HLSL effects, and what's been posted here in this thread? Has any further tweaks/settings ability been added? Will the new eFX injector bring anything new to the table related to the CRT shader?

Just curious

8BitMonk

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 989
  • Last login:October 19, 2023, 05:27:00 pm
Thanks for this info, after doing some testing I'm still amazed at how good the HLSL settings looks on my LCD display. I have an AVGA and multi-sync arcade monitor in my cab for comparison and while this isn't as good, it's come a long way and is getting remarkably close. I never thought you'd be able to fully reproduce the arcade look on newer monitors but this is starting make me wonder. I'll bet if you put it behind a tinted glass it'd be even closer.
Games: Asteroids Deluxe | Atomiswave | Centipede | Championship Sprint | Defender | Donkey Kong | Dig Dug | Frogger | Ikari Warriors | Missile Command | Pac-Man | Pole Position | Robotron | Spy Hunter | Tempest | Super Mario Strikers

bulbousbeard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 522
  • Last login:August 25, 2015, 11:58:25 pm
  • I want to build my own arcade controls!
I spoke with MAMEdev today, and this change is going to be incorporated in the next version of MAME.

http://mame.dorando.at/svn/?rev=26400

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7411
  • Last login:March 14, 2024, 05:26:05 am
  • Quote me with care
Sounds great, bulbousbeard. I still need to test this myself here.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi