Author Topic: Showing off GLSL Mame.  (Read 72580 times)

Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Re: Showing off GLSL Mame.
« Reply #45 on: June 12, 2015, 04:45:48 PM »
I really wouldn't expect the RPi2 or any of those types of devices to be able to do decent GL stuff like shaders. Much less if done in software.

Just updated the https://github.com/Luke-Nukem/attract-extra again. Decided to split the AM and MAME versions of the shaders apart. Getting issues with MAME not liking variables being of 'uniform' type which is required by AM to be able to assign values from .nut scripts.

I'll convert the other CRT style shaders to AM soon too.


EDIT: Added Lottes shader to git. Shader includes CRT geometry code in it.
« Last Edit: June 12, 2015, 05:33:38 PM by Luke_Nukem »

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: Showing off GLSL Mame.
« Reply #46 on: June 12, 2015, 06:28:51 PM »
Awesome job!

The Basic one looks great, runs great! Halation drags my system a bit - if I open the menus there is quite a delay in key presses - I am on an older MBP not the greatest of specs, but it feels like maybe something is dragging it down?I also noticed switching between the layouts seemed to cause weird results, or crashed AM (1.5.2-64bit). For instance,  the Lottes one Was messed up (small black boxes rather than scanline look), but when I exited and came back in it was fine.

I'll give them another shot on my better spec'd PC, but I am super glad you are getting these working!

Are you putting the Mame ones on there as well, or somewhere else? Also, you can pass the values for your shader variables from AM, right? It'd be cool to include those in the layout config to play with the settings :P
« Last Edit: June 12, 2015, 06:33:12 PM by liquid8d »

Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Re: Showing off GLSL Mame.
« Reply #47 on: June 12, 2015, 07:48:40 PM »
I keep updating the Git. The Basic one isn't mine, it's one that Raygun already converted.

It's bound to drag a bit. The Halation one is doing a heck of a lot of passes. But I've trimmed it back a fair bit and done some clean-ups. The latest git commit should be good.
As an example, on my Intel gpu, it took approx 3-4 seconds to load a game. With the new version on git, it takes about 1.5 seconds or less. And the Gaussian filter is doing around 6 passes less per pixel I think. I'll keep tweaking away at it.

The Lottes one, I get glitches also. Still trying to work that one out.

Mame shaders are included in both folders (MAME__*shadername*.tar.gz) just extract them to mame/osd and update your mame.ini accordingly. You should only use one shader. No extras, and turn off all extra filtering.

Attract Mode reloads the shaders each time it loads a new layout or refreshes the layout. If the shader is taking a while to load, that's where the slow down is.

Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Re: Showing off GLSL Mame.
« Reply #48 on: June 13, 2015, 12:01:14 AM »
More tweaking. Shader now loads a heck of a lot faster on Nvidia hardware. (Halation Shader, AM + Mame).
Can you guys test it please?

verion

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 861
    • View Profile
    • new projects
Re: Showing off GLSL Mame.
« Reply #49 on: June 13, 2015, 01:08:14 AM »
I'm on it.

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: Showing off GLSL Mame.
« Reply #50 on: June 13, 2015, 01:18:09 AM »
Just gave the AM shaders a try.. I'm still getting a some weird results but the halation is definitely faster.

I have 2 machines I'm testing on:

MBP w/ Intel HD 3000, i5 2.3Ghz ( Win 8 )
Basic and Halation work fine
Lottes is funky - first it looked like little flies buzzing around the screen.. best I can describe it :) Then just blank screen.
Each time I try to switch from any one of them to the other, AM crashes.

Desktop w/ Nvidia GTX 570, i7 3.8Ghz ( Win 7 )
Halation is about 1/6 of the layout size, in the center of the screen. I tried changing the layout res to match my desktop and it made it smaller! The effect is there, but the layout is shrunk.
Lottes is completely black
This one does not crash when I switch layouts

Won't get to test the Mame ones until tomorrow

verion

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 861
    • View Profile
    • new projects
Re: Showing off GLSL Mame.
« Reply #51 on: June 13, 2015, 01:25:24 AM »
RE: halation-crt

I must say I like the previous one better (CRT-geom).
It gives me more crisp image - without beeing pixelated. The last one is more muddy.

I have to try that in games - maybe it is better with moving objects.

----

RE: lottes-crt

It gives me corrupted screen ("little flies buzzing around the screen")
« Last Edit: June 13, 2015, 01:47:25 AM by verion »

Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Re: Showing off GLSL Mame.
« Reply #52 on: June 13, 2015, 01:48:41 AM »
I'm not worrying about Lottes for the moment, just focusing on Halation.

I'll upload the changes I've made soon, done some heavy tweaking.
Don't forget to open the CRT-halation.vsh for mame, and make adjustments.

Also, open the layout and fiddle too, specifically for both of them, change the aperture, as this has the largest visual impact right after bloom.

verion

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 861
    • View Profile
    • new projects
Re: Showing off GLSL Mame.
« Reply #53 on: June 13, 2015, 01:50:50 AM »
Not working in mame for me.

I've copied shaders to my shader dir from your github layouts (and of course changed mame.ini) - it that ok? Or maybe I'm missing something.
Shaders are "working" - no errors, game starts, I can hear the sound - but the screen is blank (black).
« Last Edit: June 13, 2015, 01:53:23 AM by verion »

Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Re: Showing off GLSL Mame.
« Reply #54 on: June 13, 2015, 02:09:24 AM »
Not working in mame for me.

I've copied shaders to my shader dir from your github layouts (and of course changed mame.ini) - it that ok? Or maybe I'm missing something.
Shaders are "working" - no errors, game starts, I can hear the sound - but the screen is blank (black).

No, you need to use the ones in MAME__CRT-halation.vsh.tar.gz
The AttractMode shaders have to use a different variable initializer to be able to modify variables in script.
Technically the Mame versions should work in AM, but you have to open the .vsh to do tweaking. AM versions != work in Mame.

So open the layout.nut, and look at each shader.set_param, I've included comments to help work out what each do too.

The attached screens are with aperture set to 2.0 (You have to use floats, I can't get AM to pass through integers).

JUST TO BE CLEAR - PLAY WITH THIS
Code: [Select]
                // APERATURE_TYPE
                // 0 = VGA style shadow mask.
                // 1.0 = Very compressed TV style shadow mask.
                // 2.0 = Aperture-grille.
                shader.set_param( "aperature_type", 2.0 );

[attachment deleted by admin]
« Last Edit: June 13, 2015, 02:11:53 AM by Luke_Nukem »

verion

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 861
    • View Profile
    • new projects
Re: Showing off GLSL Mame.
« Reply #55 on: June 13, 2015, 02:55:35 AM »
Please forgive me my ignorance - but belive me, this is the first time when I'm using Github :)

I can't find MAME__CRT-halation.vsh.tar.gz anywhere in https://github.com/Luke-Nukem/attract-extra

only
/layouts
/plugins
/romlists

and there is no MAME__CRT-halation.vsh.tar.gz in any of that folders.
I'm clueless.

I'm more comfortable with juggling my pixels.

Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Re: Showing off GLSL Mame.
« Reply #56 on: June 13, 2015, 03:12:21 AM »
Shit. Must be in my .gitignore list.
Attached now. (can open with 7zip or similar)
« Last Edit: June 13, 2015, 03:29:32 AM by Luke_Nukem »

verion

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 861
    • View Profile
    • new projects
Re: Showing off GLSL Mame.
« Reply #57 on: June 13, 2015, 03:50:22 AM »
OK. Now I can see it on Github too.

Working great.
100% frames all the time.
CPU at around 50%

As a side note - my laptop is getting pretty hot, I think it is more from GPU than CPU.

---

You've said that the halation is very tasking - is there a way to disable halation in .vsh for slower system?

If
additive_bloom = 0
bloomAmount = 0
the halation is off?

---

BTW can you post your mame.ini for reference?
I would like to see what do you mean by saying "No extras, and turn off all extra filtering"

Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Re: Showing off GLSL Mame.
« Reply #58 on: June 13, 2015, 04:16:03 AM »
I'm considering making a switch to disable Bloom. Trying to work out the calculation count is a little hard, I think it's around 130 calculations per pixel.
What will most likely happen is the GPU will utilize all it's shader units, which is basically the whole programmable pipeline.

You might be better off to try the Lottes shader for Mame if you just want to remove Bloom. I bet it get's just as hot though.

The original Halation did a heck of a lot more calculations, I'd guess from memory, approx 90 or more extra per pixel.

EDIT::
additive_bloom = 0
bloomAmount = 0

Bloom is always on atm. So setting bloomAmount to 0.0 just means it will be doing math with a 0.0 amount, mostly addition and multiplication.

additive_bloom = 0.0; will switch the final bloom calculation to a slightly different one where it isn't just adding the worked out Bloom to the existing screen pixels. Not worth turning off to be honest, unless you like the look of the different pipeline.

I'm still learning the GLSL, it's a pretty big step up from what I've been studying at University, but at least I can think like a programmer and work things out  ;D

I'll see if I can sort out the AM version of Lottes tomorrow. It should be fine for the Mame version though.
« Last Edit: June 13, 2015, 04:20:00 AM by Luke_Nukem »

verion

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 861
    • View Profile
    • new projects
Re: Showing off GLSL Mame.
« Reply #59 on: June 13, 2015, 06:12:42 AM »
I can see you uploaded Lottes shader too - I'll try that and let you know.

---

Not working - gives me black screen (but the game is running).
« Last Edit: June 13, 2015, 06:31:17 AM by verion »