MAMEUIFX

A full-of-features version of MAME designed for LCD monitors
It is currently 22/09/2019, 7:27

All times are UTC+02:00




Forum locked  This topic is locked, you cannot edit posts or make further replies.  [ 18 posts ]  Go to page 1 2 Next
Author Message
PostPosted: 01/03/2015, 19:25 
Offline
Moderator
Moderator
User avatar

Joined: 17/10/2014, 12:02
Posts: 108
Location: Germany
Hello mamesick,

I have a problem with enabling OpenGL in UIFX. I mean I can enable it in the options, but nothing happens. I use the Timothy Lottes shader succesfully in SDL Mame, but I cant use it with the actual MAMEUIFX. There is no option to point to the shader that should be used, so I just tried to put a additional line into the mame.ini like this:

glsl_shader_mame0 D:\GAMESTATION\MAME\SDL_MAME_0159_64\glsl\Lottes_CRT

but it still doesnt show up :( . My question is how to enable it to work with MAMEUIFX.
If you have any questions, than i will try to answer them.

thx in advance , u-man

PS: This is what the "whats new" states:

-Make OpenGL renderer available in mainline build as well. This needs
to be explicitly enabled by specifying USE_OPENGL=1. More code
alignment. [Couriersud]

So my guess is, you need to compile it, before you can use it. I dont know what exactly is to do, to get it work, but my SDL MAME version works fine.

_________________
"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."


Top
   
PostPosted: 02/03/2015, 9:08 
Offline
Admin
Admin
User avatar

Joined: 17/09/2014, 16:04
Posts: 695
Location: Italy
GLSL options will be available for OpenGL in Windows in the next release:
http://git.redump.net/mame/commit/?id=f33d0614c397ad25b16523f96910cc8fdc1a8a00
This commit has been submitted after 0.159 was out so you have to wait for next 0.160. MAMEUIFX though will not support all GLSL options in the short time, put them in the GUI is a looooong work, but of course you'll be able to modify them manually in MAME.INI.
At the moment in Windows OpenGL is like GDI, a simple renderer without any feature.


Top
   
PostPosted: 02/03/2015, 17:05 
Offline
Moderator
Moderator
User avatar

Joined: 17/10/2014, 12:02
Posts: 108
Location: Germany
I can only partially agree to your comment :) .
You can have OpenGL with a current GIT. I did mine with this: http://git.redump.net/mame/commit/?id=f ... 8fdc1a8a00

mamesick wrote:
At the moment in Windows OpenGL is like GDI, a simple renderer without any feature.


You can use OpenGL shaders now, that is not just a simple renderer without any feature. Indeed it will not be a easy task for the GUI implementation, as you need to define a path for the shader you want to use.

There is this awesome shader here, by Timothy Lottes: https://www.dropbox.com/s/z873a41i5ty2q ... 0.zip?dl=0

You can test it with my selfcompiled 64Bit MAME with OpenGL enabled from the above GIT release here: https://www.dropbox.com/s/b32dmtud2gutn ... l.zip?dl=0

It contains just the EXE file, so you can replace it with your actual MAME.exe for testing. You still need to create a new mame.ini file, where you put in the changes explained below.

There are two shaders in this archive. The only difference is that the "VERT" version rotates the shadow mask by default.
The idea here is that you use the VERT version in a "vertical.ini" so that it gets used for vertical games only.
Put the files of this zip into a folder of your choice (I recommend a OpenGL named folder inside your MAME installation).

To activate the shader, you need to change the following line of your mame.ini OSD VIDEO OPTIONS section :

video opengl

and put the path to the shader in this line of the # OpenGL-SPECIFIC OPTIONS and activate the shader by following line:

gl_glsl_filter 1
glsl_shader_mame0 put the path to the content of the zip-file here\Lottes_CRT


this is just a example :

gl_glsl_filter 1
glsl_shader_mame0 D:\GAMESTATION\OpenGL_MAME_0159_64\glsl\Lottes_CRT

Make a copy of your mame.ini and put it in the ini folder of your MAME installation, naming it vertical.ini
In your copy, change the path setting to point at Lottes_CRT_VERT.

this is just a example :

glsl_shader_mame0 D:\GAMESTATION\OpenGL_MAME_0159_64\glsl\Lottes_CRT_VERT

thats it.... try it and enjoy this awesome shader

Screenshot of the shader: https://www.dropbox.com/s/373qcx644ksl7 ... L.jpg?dl=0

click on the three dots in bottom right corner to download the Screenshot to see it in full resolution.

Credits goes to Timothy Lottes (http://timothylottes.blogspot.de/2014/08/scanlines.html) and SoltanGris42 (Mameworld) for the work involved.

My tip for you: try to integrate this shader into the OpenGL option, so that people dont need to hassle with the installation and they can benefit from the new OpenGL option. In the meantime, you can think about, how to implement the OpenGL feature to its full glory. I think there will be more OpenGL shaders in the future, as all RetroArch shaders are OpenGL based and there will be conversions for MAME usage for sure :D .

So all in all, this is a good idea or not? If you want we can talk about shaders in general, because I have some HLSL shader from Jezze, that is awesome too and even fixes bugs from regular HLSL. My dream would be to see MAMEUIFX with these shaders in a userfriendly way. Being the best solution for LCD Monitors on this planet ;) .

Greets 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."


Top
   
PostPosted: 02/03/2015, 18:03 
Offline
Admin
Admin
User avatar

Joined: 17/09/2014, 16:04
Posts: 695
Location: Italy
I have here a working OpenGL MAMEUIFX. It's self-compiled for my personal use with latest MAME SVN/GIT source code. And I'm already testing and starting to implement full support for GLSL shaders. As you may imagine, the vast majority of users don't compile their own MAME but wait for the monthly release. So, to be clear, in official MAME 0.159 OpenGL is disabled, it's enabled for testing purpose in MAMEUIFX but it has no features except for simple bilinear-filtering which is available in Direct3D too. In the next MAME 0.160 we will have full working OpenGL renderer with all the features and hopefully I'll be able to start to add some of them, maybe just the very simple ones... for example, where MAME core looks by default for OpenGL shaders? It's always the Artwork folder? I have to investigate a little.
I'm interested in the modified HLSL files, is there a link?
Thanks.


Top
   
PostPosted: 02/03/2015, 20:04 
Offline
Moderator
Moderator
User avatar

Joined: 17/10/2014, 12:02
Posts: 108
Location: Germany
Yes, yes i know, OpenGL doesnt work with the official MAME 0159. Nice to hear that you are aware of this and allready take your precautions. Problem with OpenGL is, there are no sliders for it, like in HLSL. In my example, you would need to go into the shader-code itself to make changes. It is well documented, just take a look into it (open with Notepad++ or similar). Also there is no default path for OpenGL, but maybe in the next release (i dont think so, because there was no path in SDL MAME either). You should just make a default path folder for MAMEUIFX on your own, like you did for other things in MAMEUIFX.

The key line here is: glsl_shader_mame0 to glsl_shader_mame9. Basically it means, you can put up to 10 OpenGL shaders to create one BIG OpenGL shader, like they allready do in RetroArch (up to 12 shaders). After any glsl_shader_mame0-9 line, you just put the path to the glsl shader, like i did in the example in the post before.

Off course, you can test the Jezze HLSL shader, here is the link: https://www.dropbox.com/s/3veh7pletvws0 ... X.zip?dl=0

The artwork folder contains three different shadowmasks, that you can use with the mask settings in the textfile (you can only use one at a time).

The bloom.fx file, is a bugfixed bloom, that eliminates the following error (high bloom settings where used to see it more clearly):

Official bloom.fx: https://dl.dropboxusercontent.com/u/541 ... r-type.png

You can see, that the bloom has a wrong offset. A bloom would normally shine in every direction, not just like in the picture above, where it works like a Photoshop-dropshadow effect.

Fixed bloom.fx: https://dl.dropboxusercontent.com/u/541 ... r-type.png

The bloom shines to all directions, if you switch between the pictures, you will see what i mean.

The post.fx file, is a highly modified official post.fx . It has many advantages, like a shadowmask, that is ALWAYS perfectly aligned and eliminating the moire-artefacts, that you usually get, if you use official post.fx. also in the official post.fx, you need to adjust the shadowmask properly for EVERY game with different resolution (which is not a easy task, you need to be good in math-calculations :D ).
Then you have a additional Vignette and Reflexion effect, which you can control via the HLSL parameters.
Image Pincushion controls the how strong the Vignette is and Screen Curvature controls the curvature of the screen and the amount of the reflection. Sadly the MAME devs didnt want to give us one more slider for the reflection only, so Jezze needed to merge it with the curvature parameter, but at least it makes some sense, because a high curvature of a CRT will result more likely to a pointed reflection in a real life environment.

You can basically see how this shader works here: http://www.aep-emu.de/index.php?name=PN ... rt=0#89863
Sadly it is in german, but you will get how it works from the pictures ;) . I am also translating everything in english right at the time and I am nearly finished.
Also the thread is very old and is not the current state of the shader, but I have send you here the most current one, as I am in contact with Jezze all the time. Also the bloom fix bug is missing in the thread.

We found these settings the best for the HLSL shader as a default setting:

#
# 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 1080
shadow_mask_alpha 0.250000
shadow_mask_texture crt_shadow_mask.png
shadow_mask_x_count -3
shadow_mask_y_count -2
shadow_mask_usize 0.375000
shadow_mask_vsize 0.250000
curvature 0.150000
pincushion 0.200000
scanline_alpha 0.600000
scanline_size 1.000000
scanline_height 1.500000
scanline_bright_scale 1.000000
scanline_bright_offset 0.500000
scanline_jitter 0.050000
defocus 0.000000,0.000000
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.200000
offset 0.015000,0.015000,0.015000
scale 0.900000,0.950000,0.950000
power 1.300000,1.100000,1.000000
floor 0.01,0.01,0.01
phosphor_life 0.4,0.4,0.4

#
# 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 40.0

#
# BLOOM POST-PROCESSING OPTIONS
#
vector_bloom_scale 0.3
raster_bloom_scale 0.220
bloom_lvl0_weight 1.000000
bloom_lvl1_weight 0.320000
bloom_lvl2_weight 0.16
bloom_lvl3_weight 0.08
bloom_lvl4_weight 0.04
bloom_lvl5_weight 0.02
bloom_lvl6_weight 0.02
bloom_lvl7_weight 0.01
bloom_lvl8_weight 0.01
bloom_lvl9_weight 0
bloom_lvl10_weight 0

So have fun with this and try it for yourself. As I like MAMEUIFX the most for LCD, i hope you like my suggestions. I just want to see some nice shaders implemented at default for novice users and MAMEUIFX.

Hope to hear from you soon. Best wishes, 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."


Last edited by u-man on 04/03/2015, 20:05, edited 1 time in total.

Top
   
PostPosted: 03/03/2015, 13:30 
Offline
Admin
Admin
User avatar

Joined: 17/09/2014, 16:04
Posts: 695
Location: Italy
Thanks for the info and links. I'm not too much into HLSL, I don't use it at all, but if there's a fix, it should be distributed. Am I allowed to put the JEZZE bloom.fx into my distribution? I believe post.fx is still WIP, so I prefer still use the original for the moment.

The same for Timothy Lottes GLSL shaders. Are they freely distributable in a MAME build? My plan is to create a \GLSL\ folder in MAMEUIFX which will contains the shader files and that will can be selected directly from the GUI, like it happens now for generic effects in \ARTWORK\ folder. I believe a good start is include the Lottes' ones by default, then maybe add others in the future and leave to final users the choice of which use, etc. etc.


Top
   
PostPosted: 03/03/2015, 17:47 
Offline
Moderator
Moderator
User avatar

Joined: 17/10/2014, 12:02
Posts: 108
Location: Germany
What shall I say.... MooglyGuy (i think he is the creator of HLSL) is not interested to do something. I allready mentioned and opened a thread at MAMEworld regarding the bloom bug. To be honest, I think he doesnt like me, he is always complaining about my bad english and stuff like that. A arrogant and ignorant person IMHO. I also talked about Jezze´s shader there and asked if it is possible to either include a slider for the reflection parameter or include Jezze´s shader in general.... without a success, only rampage :( . Not the guy, that can stand a critic, in my eyes.

Back to topic: You can still use the post.fx as it will always be WIP ;) . You need to rename it to post.fx off course, as it will not work with that name, I just forget it to do, as I was too excited about your interest :) . I contacted Jezze to either contact you or give the permission for doing your part. I think he will agree to this, as long as he is credited and maybe contain a link to his thread. He is the opposite of MooglyGuy ;) . I also contacted SoltanGris42, as he did the conversion of the Timothy Lottes shader for MAME usage. So be prepared for some mails :) . I am very happy with your decision to give all of this a try. I just want to see improvements and benefits for a novice user, that dont need to be a nerd like we are :D , just to have some nice looking gaming experience.

There are some points to consider, regarding OpenGL and requirements: OpenGL is very resource hungry, I can not play well with integrated Intel HD 4000 graphics. So it would be wise, to inform people that a dedicated graphicscard with OpenGL 2.0 support is recommended, if they wish to use it.
The other point is, to somehow make sure that the "Lottes_CRT_VERT" is used, if a user picks a vertical game. If it is not used, the shadowmask will be not properly alligned and would be wrong ( think of the horizontal and vertical scanlines here ;) ) .

Jezze´s HLSL shader on the other side, is very resource friendly. I have no problems at all, with integrated Intel HD 4000 graphics. My idea is, that a user have two choices for shaders, based on their own hardware, they can choose from ;) and both will deliver better results than regular HLSL or at least alternatives. Words can not describe it for me, how awesome it would be, to see both shaders integrated in MAMEUIFX in a user friendly GUI. You may remember that I wanted to start a project for dummies, but I am not a good coder and I think this solution would be some of the best possible. I am just a guy, who likes synergy and bringing people together, making good stuff even better.

If all of this is something worth for you, I also would be very happy about a credit or a mention, not for selfish stuff, just for reputation and upcoming future ideas, because it makes colaborations with people a lot easier for me, if i can show up something too. But it is not necessary, if you dont want or like it. If you like my ideas, I have two more very interesting things for you, regarding vector graphics and lightguns for future improvements and bringing MAMEUIFX even further. Lets work step by step and reach the goal :) .

Best wishes, u-man

PS: If this will happen for real, I will finish the translation for Jezze´s shader guide in no time. So you have a tutorial for that shader too ;)

_________________
"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."


Top
   
PostPosted: 04/03/2015, 4:35 
Offline
Moderator
Moderator
User avatar

Joined: 17/10/2014, 12:02
Posts: 108
Location: Germany
Timothy Lotte has given permissions for use.

Here is what he e-mailed me:

"Definitely feel free to take the shader, modify, optimize, do
anything, etc.

When creating that and posting it I was hoping that it would get integrated
into stuff.

Glad to see someone taking it.

There are a bunch of optimizations possible. For instance I usually
separate it into 2 passes.

First pass to do the horizontal blur and enlargement, then the second pass
to do the vertical blur and enlargement.

Much faster that way.

Feel free to ask any questions, etc.

-Timothy"

Nice person by the way :)

_________________
"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."


Top
   
PostPosted: 04/03/2015, 9:17 
Offline
Admin
Admin
User avatar

Joined: 17/09/2014, 16:04
Posts: 695
Location: Italy
Good. I'm not into this kind of things (blur, scanlines, shaders, etc.) but hopefully start to make it available in a MAME build, even if still considered a "full-of-hacks-and-shit" version by some guys at MAMEWorld, is a good step.... maybe someone else will take care of Lottes' work and start to do the optimizations he's talking about.
The interface panel for OpenGL is mostly finished here, now it's time to test intensively and check for bugs.
Unfortunately this is not doable for Windows HLSL options. Due to a "bug" (or intentionally coding, who knows) it's not possible pass parameters and values for HLSL sliders to the core directly from the interface. At the moment you can only "Enable HLSL" and then do your changes during game with the internal TAB menu. I'll look at this in the future, not immediately, just to check if at least some simple "enable/disable" options can be configured from the interface.
In the meantime, after had JEZZE permissions, I'll be proud to include his modified HLSL shaders into my distribution. I think it's a good start too.
Well, you say you're not good at programming though I'm pretty sure you'll be able to start here a new stickied thread about OpenGL and HLSL and share with us all your knowledge about these features. ;) You're invited to do this after when 0.160 will be out. So take your time.


Top
   
PostPosted: 04/03/2015, 19:31 
Offline
Moderator
Moderator
User avatar

Joined: 17/10/2014, 12:02
Posts: 108
Location: Germany
My true love, if it comes to MAME, is playing on a CRT (or tv-tube) with GroovyMAME. I use a 27" CRT-Arcade-cab and a 27" NEC 3PG Studio-Monitor (also CRT), when I play my games. This is the best gaming experience you can have and it is truly RETRO :) . No input-lag, over 90% of the games (3D games excluded) behave like the "real" ones.

But occasionaly i also play on LCD (my bartop i.e.) and the best setup there (hands up), is your MAMEUIFX. Very user-friendly and a very fast GUI (i.e. start-up time) , also with many nice features I like a lot. But playing with LCD, i see no way around to play WITHOUT shaders. They are essential for me, to have that CRT "look & feel".

But back to topic... OpenGL: I think those optimizations are allready done by SoltanGris42 in his MAME conversion of Timothy´s shader. Just for your info and better understanding: The initial shader by Timothy Lotte, is just a shader for shadertoy, as you can see it here: http://timothylottes.blogspot.de/2014/08/scanlines.html

You cannot simply use this shader for MAME or any other Emulator. It needs to be converted to a understandable shader for MAME or other Emulators. This MAME conversion was done by SoltanGris42 (we need also a permission from him, so to say). RetroArch has also converted Timothy Lottes shader, thats why they can used it a long time ago, with their MAME core (which is bad by the way).

Back to topic.... HLSL: I am aware of the HLSL-sliders and parameters problem and thats why it is important to "find" a good "initial default setting" for Jezze´s shader. That way we can asure a user-friendly "wow" effect, because most people will not start to fiddle with sliders, if there is a good start ;) .

these HLSL parameters:

hlsl_ini_read
hlsl_ini_write
hlslini

contained errors since MAME 0149 and where removed in 0150. These parameters and the removal are the cause, why it is impossible for you to pass parameters and values for HLSL sliders to the core directly from the interface. ;)

I have talked to Jezze yesterday and he said, there are no problems with permissions and you can use his stuff, as long as credited :) .
He also said, just to wait a day or two, because he has done even more improvements to his shader, that he will send me maybe even today :D
But for testing and implementing, you allready have the newest and exclusive shader, that nobody else has.

mamesick wrote:
I'm not into this kind of things (blur, scanlines, shaders, etc.) but hopefully start to make it available in a MAME build, even if still considered a "full-of-hacks-and-shit" version by some guys at MAMEWorld, is a good step.


To be honest, you should give a fuck to this. Some people are really strange there and some decisions are really questionable. I allready showed you the bloom bug, but thats not all. The coding of HLSL contains numereous logical errors. Stuff that even Jezze cant fix, because it is badly coded.

i.e. the bloom bug fix: as you can clearly see in the picture, the scanlines are bloomed too :D this is just a big failure, because in the real world or the real scanlines wouldnt be affected by bloom. scanlines would need to be excluded from the bloom process, which is not the case and would be rendered on to the final picture after bloom processing... that would be the correct way. But you can see this only on excessive use of bloom (like in the picture). So the devs never changed this "wrong" logic, maybe thinking people will never find out :D . The result is, the bloom.fx is affecting the final picture in a wrong way..... but hey, "we are so accurate... we want true emulation of crt-shadow-masks of a Sony PVR monitor... bla bla bla"... bunch of idiots if you ask me. They didnt touch HLSL code in a long time, even when people (like me) showed them, how wrong they are.
So give a shit on their talk and their ignorance... this is my advice to you, because you are doing a good job, especially in the interest of a normal "casual" MAME user.

Greets, u-man

PS: Yesterday i have compared the different shaders, OpenGL vs. HLSL (direct3d) and found out interesing things. It seems that OpenGL has a way better handling of the graphics-layer than Direct3D and it doesnt matter, if you use shaders or not. I did all of the testing only on a LCD (not at home right now, cant test on CRT).

i.e. you can try Wonderboy Deluxe and compare the two different graphic-engines. At default settings, Direct3D creates tearing and stutter (the moment where attract mode starts). Now if you start the same game with default settings and OpenGL, all errors are gone. It seems that every game that runs at different speed from 60Hz, looks way better on OpenGL at default settings with audio synced (the audio is NOT pitched, to stay sync).

I am really impressed how OpenGL turns out.
Also I did post you a default setting for HLSL with one big error in it. The prescale of the HLSL settings should be 3 not 0 , i corrected this, in the right post. Sorry for that.

_________________
"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."


Top
   
Display posts from previous:  Sort by  
Forum locked  This topic is locked, you cannot edit posts or make further replies.  [ 18 posts ]  Go to page 1 2 Next

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited