MAME HLSL CRT SCANLINE EMULATION PRESETS

The place for all discussion on gaming hardware
User avatar
nesrulz
Posts: 181
Joined: Wed Nov 13, 2013 6:01 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by nesrulz »

Now we have GLSL in MAME. Who is tested?
It seems a very hardware-demanding...
User avatar
Floob
Posts: 81
Joined: Fri Jul 25, 2014 10:58 am
Location: UK

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Floob »

I'm using INI Creator v0.3 and it has some fantastic HLSL setups that I'm very happy with.
http://mame-hlsl-gallery.blogspot.pt/p/blog-page.html

Although I am finding the SNK roms to be quite dark - anyone else finding that?
Here is an example:
http://youtu.be/4n6S5NzBAu4

I've tried tweaking the brightness and contrast, but I'm really not much good at this and it always looks a little washed out.
Here is the source/neogeo.ini I have:
http://pastebin.com/raw.php?i=sf6VMgW8

Does anyone have any recommendations?
User avatar
Floob
Posts: 81
Joined: Fri Jul 25, 2014 10:58 am
Location: UK

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Floob »

For reference, here is DoDonPachi which looks pretty good to me:
https://www.youtube.com/watch?v=VW_89PXPf3w

Using stock settings by Nueda in the 03 ini creator.
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 »

nesrulz wrote:Now we have GLSL in MAME. Who is tested?
It seems a very hardware-demanding...
is GLSL in mame now, how do you enable it?
User avatar
nesrulz
Posts: 181
Joined: Wed Nov 13, 2013 6:01 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by nesrulz »

Display > Video mode > OpenGL

Image

MAMEUIFX64 here...
User avatar
Floob
Posts: 81
Joined: Fri Jul 25, 2014 10:58 am
Location: UK

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Floob »

In Emu Loader 7.7.3

Main Menu | Emulator Default Settings | Video 2

Image


Not sure if what happens if that is enabled at the same time as HLSL though ?!
User avatar
Floob
Posts: 81
Joined: Fri Jul 25, 2014 10:58 am
Location: UK

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Floob »

Floob wrote:I'm using INI Creator v0.3 and it has some fantastic HLSL setups that I'm very happy with.
http://mame-hlsl-gallery.blogspot.pt/p/blog-page.html

Although I am finding the SNK roms to be quite dark - anyone else finding that?
Here is an example:
http://youtu.be/4n6S5NzBAu4

I've tried tweaking the brightness and contrast, but I'm really not much good at this and it always looks a little washed out.
Here is the source/neogeo.ini I have:
http://pastebin.com/raw.php?i=sf6VMgW8

Does anyone have any recommendations?
Ok, this could easily be 100% me not understanding how the ini files are read, but if I change /source/neogeo.ini to source/neogeo_noslot.ini things look like they get a hell of a lot better for SNK games (or maybe its just my eyes!).

I'm not sure how to check which ini a given rom would use. I only worked out the example above by this type of data from Emu Loader

Image
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 »

nesrulz wrote:Display > Video mode > OpenGL

Image

MAMEUIFX64 here...

Ah im just using vanilla MameUI which doesn't appear to have that option.

So MAME doesnt use the .glsl file format it uses .vsh for its glsl shaders?? How can you conver glsl to vsh file type?
Last edited by lettuce on Mon Apr 06, 2015 12:03 pm, edited 1 time in total.
User avatar
Xyga
Posts: 7181
Joined: Tue Nov 05, 2013 8:22 pm
Location: block

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Xyga »

I think it's only MAMEUIFX right now.
Strikers1945guy wrote:"Do we....eat chicken balls?!"
User avatar
Floob
Posts: 81
Joined: Fri Jul 25, 2014 10:58 am
Location: UK

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Floob »

Floob wrote:
Floob wrote:I'm using INI Creator v0.3 and it has some fantastic HLSL setups that I'm very happy with.
http://mame-hlsl-gallery.blogspot.pt/p/blog-page.html

Although I am finding the SNK roms to be quite dark - anyone else finding that?
Here is an example:
http://youtu.be/4n6S5NzBAu4

I've tried tweaking the brightness and contrast, but I'm really not much good at this and it always looks a little washed out.
Here is the source/neogeo.ini I have:
http://pastebin.com/raw.php?i=sf6VMgW8

Does anyone have any recommendations?
Ok, this could easily be 100% me not understanding how the ini files are read, but if I change /source/neogeo.ini to source/neogeo_noslot.ini things look like they get a hell of a lot better for SNK games (or maybe its just my eyes!).

I'm not sure how to check which ini a given rom would use. I only worked out the example above by this type of data from Emu Loader

Image
That seems to be what it is:
https://github.com/mamedev/mame/blob/ma ... o_noslot.c

And I can see to confirm the driver used -listxml can be run.

So I'm happy creating a copy of neogeo.ini to create neogeo_noslot.ini is warranted in this case.

In addition, this confirms the ini ordering:
http://easyemu.mameworld.info/mameguide ... onfig.html

So a game will read
mame.ini first
which will get overridden by values in
<driver.ini>
which will get overridden by values in
<parent game>.ini
which will get overridden by values in
<clone game>.ini (if there is one)
mremulator
Posts: 26
Joined: Mon May 26, 2014 10:05 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by mremulator »

Guys,

Really like the Lottes CRT shader... However, can't seem to get filtering to work? Pixels just look too perfect to me.
I've tried all the options in the Nvidia CP and enabled the following in mame.ini:

#
# OpenGL-SPECIFIC OPTIONS
#
gl_forcepow2texture 0
gl_notexturerect 0
gl_vbo 1
gl_pbo 1
gl_glsl 1
gl_glsl_filter 1
glsl_shader_mame0 shader\Lottes_CRT

Also, is there anyway to add CRT geometry (curve) or raster boom like in HLSL?

I heard that this shader had been ported to HLSL, but I can't find it anywhere??
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 »

mremulator wrote:Guys,

Really like the Lottes CRT shader... However, can't seem to get filtering to work? Pixels just look too perfect to me.
I've tried all the options in the Nvidia CP and enabled the following in mame.ini:

#
# OpenGL-SPECIFIC OPTIONS
#
gl_forcepow2texture 0
gl_notexturerect 0
gl_vbo 1
gl_pbo 1
gl_glsl 1
gl_glsl_filter 1
glsl_shader_mame0 shader\Lottes_CRT

Also, is there anyway to add CRT geometry (curve) or raster boom like in HLSL?

I heard that this shader had been ported to HLSL, but I can't find it anywhere??
Download the shader pack from here...

http://www.mameau.com/mame-glsl-shaders-setup/

has the crt-gemo shader, just copy the 4 files to the glsl folder in your mame directory
mremulator
Posts: 26
Joined: Mon May 26, 2014 10:05 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by mremulator »

Thanks.

Figured it out. Even managed to edit the geometry file to get rid of the tilt effect.

Still can't get subtle filtering or bloom though with these.

*Edit* Don't think this is the Lottes shader either, as missing shadow mask.
Last edited by mremulator on Thu Apr 09, 2015 10:55 am, edited 1 time in total.
step2ice
Posts: 1
Joined: Wed Apr 08, 2015 10:12 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by step2ice »

Floob wrote:I'm using INI Creator v0.3 and it has some fantastic HLSL setups that I'm very happy with.
http://mame-hlsl-gallery.blogspot.pt/p/blog-page.html


Does anyone have any recommendations?
I tried to get that to work with mame64, when at the batch part it always says mame has to create a ini first, so I'm stuck there.

Then I tried normal HLSL in mame an it seems to totally screw the brightness. Basically looks like this...

Image

Funny thing is that the bright part seems to be an overlay snice it doesn't react to the ingame slider menue of mame. Only the game colors fade but the bright part stays. :/

Any clues on what's wrong or help with the ini creator would be highly appreciated.
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 »

mremulator wrote:Thanks.

Figured it out. Even managed to edit the geometry file to get rid of the tilt effect.

Still can't get subtle filtering or bloom though with these.

*Edit* Don't think this is the Lottes shader either, as missing shadow mask.
Yeah its s shame that all the CRT shaders that are available for RetroArch havent been converted for MAME use
User avatar
Xyga
Posts: 7181
Joined: Tue Nov 05, 2013 8:22 pm
Location: block

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Xyga »

lettuce wrote:Yeah its s shame that all the CRT shaders that are available for RetroArch havent been converted for MAME use
Timothy Lottes's shader in MAMEUIFX is a good start though, Mamesick (well, a proxy) simply asked Timothy permission to port it.

Now we need the same thing to happen with crt-geom and more importantly crt-royale. *drool*
Strikers1945guy wrote:"Do we....eat chicken balls?!"
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 »

Xyga wrote:
lettuce wrote:Yeah its s shame that all the CRT shaders that are available for RetroArch havent been converted for MAME use
Timothy Lottes's shader in MAMEUIFX is a good start though, Mamesick (well, a proxy) simply asked Timothy permission to port it.

Now we need the same thing to happen with crt-geom and more importantly crt-royale. *drool*
CRT-easymode is also good
mremulator
Posts: 26
Joined: Mon May 26, 2014 10:05 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by mremulator »

Guys,

Tweaked a few things in Lottes shader. Really pleased with it now.

Only thing left to do is to try and implement CRT geom.... anyone??

Changes:

Edited in "Lottes_CRT"
saturation = 1.0; (default = 1.1)

Edited in "Lottes_CRT_rgb32_dir"
const float hardPix=-4.0; (makes upscaled image softer / default 6.0)
const float hardBloomScan=-2.0;
const float hardBloomPix=-1.50;
const float bloomAmount=1.5/16.0; (slightly more bloom as a result of changing these 3)

I also changed the gobal gamma setting in Mame to "0.80" and enabled Vsync.

That's about it.
User avatar
Floob
Posts: 81
Joined: Fri Jul 25, 2014 10:58 am
Location: UK

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Floob »

step2ice wrote:
Floob wrote:I'm using INI Creator v0.3 and it has some fantastic HLSL setups that I'm very happy with.
http://mame-hlsl-gallery.blogspot.pt/p/blog-page.html


Does anyone have any recommendations?
I tried to get that to work with mame64, when at the batch part it always says mame has to create a ini first, so I'm stuck there.



Any clues on what's wrong or help with the ini creator would be highly appreciated.
Run "mame64.exe -cc"
This will create a mame.ini, just copy that into your ini directory.
mremulator
Posts: 26
Joined: Mon May 26, 2014 10:05 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by mremulator »

The plot thickens...

I noticed today that there is a screen curve with the Lottes_CRT_Vert shader. However, nothing with the Lottes_CRT shader (as stated in previous post).

So, I thought I'd compare the two files again. Weird thing is I can't see any differences between the two??

It has to be in there somewhere, but I can't find it!

*Edit* they ARE Identical line-by-line! WTF?

So what else could give vertical games (on a horizontal monitor) the desired CRT geometry when using Lottes_CRT_Vert????

Once I figure it out, I can apply the same to the horizontal shader/games.
mremulator
Posts: 26
Joined: Mon May 26, 2014 10:05 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by mremulator »

Figured out how to get CRT geometry for horizontal games...

In the Lottes_CRT_rgb32.dir

Remove the "//" from "//#define CURVATURE //Screen curvature effect."


I also figured out how to up the bloom, lower the saturation & sharpness of upscaled image...

Sharpness (in Lottes_CRT_rgb32.dir):

const float hardPix=-5.0; //-1,-2,-4, etc to make the upscaling sharper.

Bloom (in Lottes_CRT_rgb32.dir):

const float bloomAmount=1.6/12.0; //Lower this if there is too much bloom!

Saturation (in Lottes_CRT.vsh):

saturation = 1.0;


Now looks like...

Image

Image

Image

Pictures don't do it justice though really.


Now all you have to do is define either the above shader for horizontal games, or the vertical one for vertical games.

Any other settings like gamma, contrast & brightness, can be adjusted on the fly using the sliders.

Looks better than HLSL to me, also has a really nice shadow mask & even scanlines.

Now CRT geometry is working for horizontal games too (needed twaeking up from "1.0" to "1.60" though). ;-)

Loving this shader!
Last edited by mremulator on Sat Apr 11, 2015 7:25 pm, edited 3 times in total.
justice99
Posts: 91
Joined: Sat May 12, 2012 2:42 pm
Location: France

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by justice99 »

I'm using GLSL with the last build of MameuiFX and it's wonderful. I cant wait to find more script like RetroArch.

MAME/MESS cores are available with RetroArch, but still buggy according to comments.
User avatar
bytestorm
Posts: 175
Joined: Wed Nov 09, 2011 5:19 am
Location: Sweden

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by bytestorm »

Mremulator, wich mame and version number are you using with lottes shader? It looks really nice and I thought I'd try it out tonight :D
Looking to buy, working or faulty: Dodonpachi, Deathsmiles, Ibara, Rainbow Islands, Bubble Bobble.
mremulator
Posts: 26
Joined: Mon May 26, 2014 10:05 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by mremulator »

Regular MameUI 0.160 ;-)
User avatar
u-man
Posts: 18
Joined: Mon Feb 24, 2014 7:17 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by u-man »

Ok, i see many posts happened here in the past and since my last visit. Dont know where to start :) .

I think I go first with the horizontal / vertical versions of Lottes shader. The vertical version has the difference, that the shadowmask (and scanlines off course) are aligned properly on vertical games. The difference is one single line in the code of the .fsh file:

#define VERTICAL //rotates shadow mask effect to fix vertical games on landscape monitors

this line is commented out by "//" in the normal version of the .fsh file.

Since I followed Soltan42 conversion of the Lotte shader since day 1, i was the person who encouraged mamesick to include this awesome shader into UIFX. he did the coding and i did the permissions and beta-testing. you can read it here: http://mame32fx.altervista.org/home.htm

Off course you can use this shader also with a official build, but you will miss the easy usage and the drop-down menue for further shader presets. so you have to do any changes manually (no option for me :mrgreen: ) and there will be more presets in the future, thats for sure :wink: I am allready on the CRT-Geom shader at the moment and the only thing missing working properly is the shadowmask, but i am on it.

As you allready found out, the problem with OpenGL is there are no sliders for parameters like in HLSL and you need to alter the code itself, to change something, which is not hard, because it is well documented. Still there is no support for vector games at all and you need a decent graphicscard for this resource hungry shader.

For that problem, we decided to include a new overhaul of Jezze´s shader, that will bring HLSL to a new level. This will be a exclusive HLSL shader for MAMEUIFX, that you will NOT find anywhere or you can use with any other version of MAME, because it will be hardcoded into the source of MAMEUIFX :mrgreen: . As our collaboration works very well, our aim is to push MAMEUIFX for all the LCD users outthere.

The improvements of Jezze´s HLSL shader so far:

- fixed bloom offset bug
- improved Defocus parameter
- improved bloom with less artifacts
- improved downsample (downscaling) with less artifacts
- major improvement of the post.fx file with seperate processes. i.e. no bloomed scanlines like in the original HLSL
- possibility of making screenshots with FX applied
- improved Vignette Parameter in comparison to old Jezze shader version
- improved Reflection Parameter in comparison to old Jezze shader version
- 3 different slotmasks to choose from
- all slotmasks with automatic alignment
- improved slotmasks versions in comparison to old Jezze shader version
- works well with low-end graphicscards, even with onboard

all of this with sliders, like in the original HLSL :P

Comparison with Jezze´s new HLSL vs. Lotte´s OpenGL:

OpenGL :

Image

new HLSL:

Image

Note that the HLSL settings are my personal taste and that is the reason why i.e. the hair-color of the girl looks different or the image in general is sharper.

Sega Turbo Comparison:

OpenGL:

Image

new HLSL:

Image

Real CRT with real PCB:

Image

Note that this time, I blurred the image more to come closer to the original CRT. I also used the Vignette (for darker corners) and the Reflection (look under Game Over), but was a little lazy with the colors :P

Yeah, thats it so far, stay tuned, good things are coming....

cheers u-man
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."
mremulator
Posts: 26
Joined: Mon May 26, 2014 10:05 am

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by mremulator »

The vertical OpenGL Turbo screenshot above looks like the #define VERTICAL parameter has not been un-commented?

I do not have the vertical artifacts here, which can be seen above.

Also the HLSL Turbo screenshot is waaay over-saturated.... my eyes are bleeding! ;-)
Last edited by mremulator on Sun Apr 12, 2015 7:07 pm, edited 1 time 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 »

Nice will there be preset for HLSL, like a lotte's or crt-geom setting?
User avatar
u-man
Posts: 18
Joined: Mon Feb 24, 2014 7:17 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by u-man »

mremulator wrote:The vertical OpenGL Turbo screenshot above looks like the #define VERTICAL parameter has not been un-commented?

I do not have the vertical artifacts here, which can be seen above.

Also the HLSL Turbo screenshot is waaay over-saturated.... my eyes are bleeding! ;-)
This is a bug of either OpenGL or the shader itself. As you may know, you cant make snapshots in fullscreen with FX applied inside MAME. So I run the game in windowed mode, but then strangely the shadowmask is not rotated. It gets even stranger, if you use the "horizontal" version, because than the shadowmask is rotated like it should be, but you have strange color moire artefacts. So if you are the smart one here, than make a screenshot of this game with a 1440x900 setting ;) .

Its not my problem that your eyes bleed, if you have read my comment, you would know, that I used my personal settings and unfortunately they didnt applied well on Sega Turbo, but here is a picture, just for you:

Image

Your changes to Lotte´s shader are no sorcery. This can be done by everyone, if they open the shader (or better said, the .fsh part of it) with a notepad(++) and change the well documented parameters, just saying ;) .
lettuce wrote:Nice will there be preset for HLSL, like a lotte's or crt-geom setting?
Yes, there will be a initial default setting for HLSL and a well documented manual, of what every parameter does. Also I am on the crt-geom shader at the moment and it will be included as a additional OpenGL preset, but I have some problems to get the slotmask working.

The crt-geom shader, looks like this right now:

Image
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."
User avatar
Xyga
Posts: 7181
Joined: Tue Nov 05, 2013 8:22 pm
Location: block

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by Xyga »

Great! :D

Any hope regarding crt-royale ?

I find the aperture grille + sample modes to be the superior solution in terms or realism and overall quality.

(Having being raised under the RGB Trinitron regime, slots/dots and curvature aren't my thing)
Strikers1945guy wrote:"Do we....eat chicken balls?!"
User avatar
u-man
Posts: 18
Joined: Mon Feb 24, 2014 7:17 pm

Re: MAME HLSL CRT SCANLINE EMULATION PRESETS

Post by u-man »

Xyga wrote:Great! :D

Any hope regarding crt-royale ?

I find the aperture grille + sample modes to be the superior solution in terms or realism and overall quality.

(Having being raised under the RGB Trinitron regime, slots/dots and curvature aren't my thing)
Hard to tell... crt-geom is a piece of cake in comparison to crt-royale, but it is definetely the next shader I will try to convert ;) .
My hopes are not high, because even a cg2glsl script cant convert the crt-royle properly :( . out of 670 shaders, it is one of 28, that dont convert. And this is just one problem, not to mention that it consist of 10 shaders stacked (if i remember it correctly).

The new Jezze HLSL shader, will have a aperture grille (good graphics card needed, as you will have to use a high prescale factor), maybe this will suit your needs. Also be aware that on all shaders discussed here, you can completely turn off curvature ;) .

I started with the easy crt-geom shader and struggle with the slotmask. I cant imagine what will happen with crt-royale :P
At least I want to convert the NTSC shader too. That one is in between of those two, regarding the difficulty level :mrgreen: .
If we would have all these 3 shaders, we would have the most meaningful ones for proper CRT simulation.

PS: It is strangely enough, that there are no conversions allready done by anybody who is skilled enough. So if someone is here, who has shader-skills, please PM me.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."
Post Reply