Build Your Own Arcade Controls Forum

Software Support => GroovyMAME => Topic started by: bulbousbeard on November 03, 2013, 12:43:31 pm

Title: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: bulbousbeard on November 03, 2013, 12:43:31 pm
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:
http://i.imgur.com/cPDH6PU.jpg (http://i.imgur.com/cPDH6PU.jpg)

After:
http://i.imgur.com/PrQ3MTp.jpg (http://i.imgur.com/PrQ3MTp.jpg)

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 (http://memegenerator.net/instance/42680609)
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: machyavel on November 03, 2013, 04:11:25 pm
Very nice and much useful tweak!
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: bulbousbeard on November 03, 2013, 04:35:18 pm
More glorious screenshots:

http://i.imgur.com/PrQ3MTp.jpg (http://i.imgur.com/PrQ3MTp.jpg)

http://i.imgur.com/pG4oMoU.jpg (http://i.imgur.com/pG4oMoU.jpg)

http://i.imgur.com/3fcItKP.jpg (http://i.imgur.com/3fcItKP.jpg)

http://i.imgur.com/lEDzFyh.jpg (http://i.imgur.com/lEDzFyh.jpg)

http://i.imgur.com/B1VPyFe.jpg (http://i.imgur.com/B1VPyFe.jpg)

http://i.imgur.com/wNlg83e.jpg (http://i.imgur.com/wNlg83e.jpg)

http://i.imgur.com/Rs67ZUr.jpg (http://i.imgur.com/Rs67ZUr.jpg)

http://i.imgur.com/bs7c6Ai.jpg (http://i.imgur.com/bs7c6Ai.jpg)
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: B2K24 on November 03, 2013, 07:11:30 pm
@bulbousbeard: can you pastebin or put your HLSL settings from mame.ini here for a test please?
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: mcilrain on November 03, 2013, 07:26:13 pm
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.
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: bulbousbeard on November 03, 2013, 07:34:15 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 (http://pastebin.com/zQZysq4y)

Note that I'm not using the standard aperture.png.
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: B2K24 on November 03, 2013, 08:25:24 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.
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: bulbousbeard on November 03, 2013, 08:50:22 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.

I run at 2560x1600 on one of my computers.
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: Calamity on November 04, 2013, 08:22:28 am
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:

http://i.imgur.com/aGJiQGM.jpg (http://i.imgur.com/aGJiQGM.jpg)

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.
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: B2K24 on November 04, 2013, 01:43:38 pm
Thank You Calamity for sharing your settings  ;D
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: Calamity on November 04, 2013, 02:32:54 pm
Thank You Calamity for sharing your settings  ;D


To be fair I grabbed those settings somewhere ;)
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: bulbousbeard on November 04, 2013, 03:11:45 pm
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.
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: bulbousbeard on November 04, 2013, 03:28:54 pm
Here's what I'm talking about. Here are Calamity's HLSL settings with the modification and a defocus setting of 1.5.

http://imgur.com/QJKbRrc (http://imgur.com/QJKbRrc)

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.
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: jdubs on November 05, 2013, 03:39:05 pm
REALLY good tips on accurate HLSL setup.

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

-Jim
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: SMMM on November 05, 2013, 10:12:27 pm
Is HLSL applicable when used on a real 15khz arcade monitor, or is it something that's only applied on a modern monitor?
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: cmoses on November 05, 2013, 10:39:31 pm
Very interesting I will have to give these a try.
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: cools on November 06, 2013, 05:18:02 am
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.
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: adder on November 06, 2013, 06:14:04 am
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
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: bulbousbeard on November 06, 2013, 11:18:44 am
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.
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: isamu on November 06, 2013, 05:24:59 pm
How do you achieve these results using SweetFX instead of HLSL?
Title: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: cmoses on November 09, 2013, 01:36:46 am
@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 (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
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: mcilrain on November 14, 2013, 02:57:14 am
What is it with emulator developers and blindness? None of them seem to know how a CRT is supposed to look.                   
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: mmg1design on November 16, 2013, 02:10:00 am
Thanks! these changes make a huge difference.
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: Boulotaur2024 on November 20, 2013, 03:05:26 pm
More glorious screenshots:

http://i.imgur.com/PrQ3MTp.jpg (http://i.imgur.com/PrQ3MTp.jpg)

http://i.imgur.com/pG4oMoU.jpg (http://i.imgur.com/pG4oMoU.jpg)

http://i.imgur.com/3fcItKP.jpg (http://i.imgur.com/3fcItKP.jpg)

http://i.imgur.com/lEDzFyh.jpg (http://i.imgur.com/lEDzFyh.jpg)

http://i.imgur.com/B1VPyFe.jpg (http://i.imgur.com/B1VPyFe.jpg)

http://i.imgur.com/wNlg83e.jpg (http://i.imgur.com/wNlg83e.jpg)

http://i.imgur.com/Rs67ZUr.jpg (http://i.imgur.com/Rs67ZUr.jpg)

http://i.imgur.com/bs7c6Ai.jpg (http://i.imgur.com/bs7c6Ai.jpg)

This looks absolutely fantastic mate.
Can you confirm the HLSL settings you posted here (http://forum.arcadecontrols.com/index.php/topic,135470.msg1399350.html#msg1399350) reflect these screenshots ?
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: isamu on November 20, 2013, 08:15:30 pm
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
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: 8BitMonk on November 20, 2013, 11:45:10 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.
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: bulbousbeard on November 24, 2013, 04:32:10 pm
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 (http://mame.dorando.at/svn/?rev=26400)
Title: Re: Found out why MAME'S HLSL always looked like ---steaming pile of meadow muffin---
Post by: Calamity on November 25, 2013, 04:13:42 pm
Sounds great, bulbousbeard. I still need to test this myself here.