MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Tried to get Timothy Lottes' CRT Shader working with SDLMAME.
#330562 - 08/25/14 04:50 AM Attachment: Lottes_CRT_Shader_Updated.zip 3 KB (206 downloads)


EDIT: Attached an updated file on 08/26

Hi Guys,

Timothy Lottes (worked for nvidia, created fxaa...) posted a public domain CRT Shader up on Shadertoy the other day:

http://timothylottes.blogspot.com/2014/08/scanlines.html

I tried to get it working in SDLMame/SDLMess. There are probably bugs (for sure there are because I don't think it works with the NTSC shader...), but it works pretty well any way. They may be fundamental errors because I'm not a programmer, don't really know how the GLSL system in MAME/MESS works, and I am easily confused by texture coordinates.

The shader's best features, IMO, are an aperture pattern that looks better than others I've seen and a sharpness parameter that is easily tweaked to your liking.

It also supports tweakable screen curvature, scanline darkness, and aperture pattern brightness.

I added a few possibly stupid things to the original shader: scanline varies with pixel intensity, contrast/gamma boost to help offset the natural image darkening of the aperture effect, a modification to the way sharpness works so that it is a little more consistent between drivers, and YUV saturation and tint settings.

If you use SDLMAME or SDLMESS with GLSL shaders, then you might want to check it out.



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Screenshot with the shader's default settings new [Re: SoltanGris42]
#330564 - 08/25/14 04:52 AM Attachment: Lottes_CRT_Shader_02.jpg 1395 KB (12 downloads)


Here's a screenshot of the current settings...

[ATTACHED IMAGE - CLICK FOR FULL SIZE]

Attachment



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Screenshot with the shader's default settings new [Re: SoltanGris42]
#330568 - 08/25/14 05:30 AM


> Here's a screenshot of the current settings...

Nice TV effect.



Windows 10 Pro 64-bit / Intel Core i5-4460 3.20 GHz / 8.00 GB RAM / AMD Radeon R9 200 Series
http://us.battle.net/d3/en/profile/Dunard-1884/
https://sites.google.com/site/o0kinghanco0o/mame_building_info (Updated on the 07/18/2017 at 9:49 PM.)



B2K24
MAME @ 15 kHz Sony Trinitron CRT user
Reged: 10/25/10
Posts: 2546
Send PM


Re: Screenshot with the shader's default settings new [Re: SoltanGris42]
#330571 - 08/25/14 05:56 AM


Thanks for this post. I'll add it to my SDL setup






SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Re: Screenshot with the shader's default settings new [Re: B2K24]
#330573 - 08/25/14 06:00 AM


> Thanks for this post. I'll add it to my SDL setup

Cool. Hope it works okay for you!

Don't forget to play with the settings in the pixel shader file.



Traso
MAME Fan
Reged: 01/15/13
Posts: 2687
Send PM


Re: Screenshot with the shader's default settings new [Re: Dullaron]
#330616 - 08/25/14 07:20 PM


> > Here's a screenshot of the current settings...
>
> Nice TV effect.

Modern TV. No triad phosphors are gonna give that.



Scifi frauds. SF illuminates.
_________________

Culture General Contact Unit (Eccentric)



Ramirez
MAME Fan
Reged: 07/06/10
Posts: 248
Loc: Brasil
Send PM


Re: Screenshot with the shader's default settings new [Re: SoltanGris42]
#330622 - 08/25/14 07:57 PM


Very cool "scanlines" and shadow mask. With a bit of bloom it would look amazing.



R. Belmont
Cuckoo for Konami
Reged: 09/21/03
Posts: 9605
Loc: ECV-197 The Orville
Send PM


Re: Tried to get Timothy Lottes CRT Shader working with SDLMAME. new [Re: SoltanGris42]
#330637 - 08/26/14 03:45 AM


Thanks, that looks great. I'd been meaning to check it out myself since it went up on Shadertoy and now I don't have to. I really love the aperture grille effect on this one.



MooglyGuy
Renegade MAME Dev
Reged: 09/01/05
Posts: 1646
Send PM


Re: Tried to get Timothy Lottes CRT Shader working with SDLMAME. new [Re: R. Belmont]
#330657 - 08/26/14 12:07 PM


> Thanks, that looks great. I'd been meaning to check it out myself since it went up on
> Shadertoy and now I don't have to. I really love the aperture grille effect on this
> one.

Yeah. Jesus. That aperture grille effect looks fucking phenomenal. I'm just slightly disappointed that it can't use a texture to define the aperture grille pattern. It damn well puts mine to shame, that's for sure.

The only real issue with the aperture grille effect is that it's not an accurate model of how it actually worked on a real CRT. If you look at the shader code, it's very clear that he has a 1:1 correspondence between the aperture and the pixels, which is something that was rarely the case on actual CRTs. In reality, the aperture grille has a fixed physical resolution in the tube, whereas the incoming signal can be whatever resolution it wants.

What I would very much like is to eventually make the HLSL code in MAME/MESS generate the aperture grille effect at the highest resolution possible, then do a gamma-correct downsample to avoid the horrible colored stripe effect you get when you crank the aperture grille intensity up. Ideally that would give both a proper physical modelling of the aperture grille as well as avoid color beating, but that'd take more time than I'm up for putting in at the moment.



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Re: Tried to get Timothy Lottes CRT Shader working with SDLMAME. new [Re: MooglyGuy]
#330696 - 08/27/14 03:35 AM


> > Thanks, that looks great. I'd been meaning to check it out myself since it went up
> on
> > Shadertoy and now I don't have to. I really love the aperture grille effect on this
> > one.
>
> Yeah. Jesus. That aperture grille effect looks fucking phenomenal. I'm just slightly
> disappointed that it can't use a texture to define the aperture grille pattern. It
> damn well puts mine to shame, that's for sure.
>
> The only real issue with the aperture grille effect is that it's not an accurate
> model of how it actually worked on a real CRT. If you look at the shader code, it's
> very clear that he has a 1:1 correspondence between the aperture and the pixels,
> which is something that was rarely the case on actual CRTs. In reality, the aperture
> grille has a fixed physical resolution in the tube, whereas the incoming signal can
> be whatever resolution it wants.
>
> What I would very much like is to eventually make the HLSL code in MAME/MESS generate
> the aperture grille effect at the highest resolution possible, then do a
> gamma-correct downsample to avoid the horrible colored stripe effect you get when you
> crank the aperture grille intensity up. Ideally that would give both a proper
> physical modelling of the aperture grille as well as avoid color beating, but that'd
> take more time than I'm up for putting in at the moment.

Yeah. On my Surface Pro 3, the resolution is high enough and screen small enough that the aperture grille effect is nearly lost. Something that doesn't map directly to the output pixels would be nice. But like you said, 1:1 mapping avoids the sampling issues for now, so it's a good start. Especially since the grille effect does look so nice.



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Updated the shader file to work with my laptop's Intel Graphics driver new [Re: SoltanGris42]
#330698 - 08/27/14 03:43 AM Attachment: Lottes_CRT_Shader_Updated.zip 3 KB (43 downloads)


Intel's driver doesn't like type casting, so the filter wouldn't compile on my laptop with Intel graphics.

Now it should work.

I think that some Linux drivers (especially from intel) are even pickier. So who knows if it works there without additional modifications. I don't have linux outside of a VM any more, so I can't test it...

I'm updating the original post with the updated version too. There shouldn't be any reason for the older one to exist.

This version is slightly different. It's slightly better organized (the stuff I added...), the defaults are more sensible (not as much saturation boost, not quite as sharp), and of course my laptop likes the fragment shader now.



bigbluefe
MAME Fan
Reged: 02/18/14
Posts: 91
Send PM


Re: Tried to get Timothy Lottes CRT Shader working with SDLMAME. new [Re: R. Belmont]
#330701 - 08/27/14 04:25 AM


Holy cow. This shader looks amazing.

I used Haze's SDLMAME build, and it seems like SDLMAME in Windows has way more audio latency than the Windows MAME. Can anything be done about that?

Also, for some reason, SDLMAME in Windows doesn't seem to work correctly with G-Sync. I get choppiness in it, but Windows MAME is fine.



TafoidAdministrator
I keep on testing.. testing.. testing... into the future!
Reged: 04/19/06
Posts: 2948
Loc: USA
Send PM


Re: Tried to get Timothy Lottes CRT Shader working with SDLMAME. new [Re: bigbluefe]
#330702 - 08/27/14 04:39 AM


> Holy cow. This shader looks amazing.
>
> I used Haze's SDLMAME build, and it seems like SDLMAME in Windows has way more audio
> latency than the Windows MAME. Can anything be done about that?

Default has it at 2. -audio_latency 1 will make it better.

> Also, for some reason, SDLMAME in Windows doesn't seem to work correctly with G-Sync.
> I get choppiness in it, but Windows MAME is fine.

Not sure. There is -video soft and -video opengl (where available).



bigbluefe
MAME Fan
Reged: 02/18/14
Posts: 91
Send PM


Re: Tried to get Timothy Lottes CRT Shader working with SDLMAME. new [Re: Tafoid]
#330704 - 08/27/14 05:16 AM


Yeah, I changed the audio latency to 1 from the get-go. It still has way more audio latency than Windows MAME. I'm kind of shocked by how big the difference is.

I'm using OpenGL since I was testing out the GLSL stuff.



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Trying MESS on my projector new [Re: SoltanGris42]
#330705 - 08/27/14 05:32 AM Attachment: Lottes_CRT_Shader_Projector.jpg 1099 KB (4 downloads)


Tried it on my projector at about 90" diagonal.

Looks good in the picture! Maybe we do need some kind of bloom effect in the shader.

[ATTACHED IMAGE - CLICK FOR FULL SIZE]

Attachment



B2K24
MAME @ 15 kHz Sony Trinitron CRT user
Reged: 10/25/10
Posts: 2546
Send PM


Re: Trying MESS on my projector new [Re: SoltanGris42]
#330707 - 08/27/14 05:52 AM


That's Awesome!







Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Trying MESS on my projector new [Re: SoltanGris42]
#330727 - 08/27/14 10:34 AM


> Tried it on my projector at about 90" diagonal.
>
> Looks good in the picture! Maybe we do need some kind of bloom effect in the shader.

Nice. I downloaded the update files. Thanks.



Windows 10 Pro 64-bit / Intel Core i5-4460 3.20 GHz / 8.00 GB RAM / AMD Radeon R9 200 Series
http://us.battle.net/d3/en/profile/Dunard-1884/
https://sites.google.com/site/o0kinghanco0o/mame_building_info (Updated on the 07/18/2017 at 9:49 PM.)



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Re: Trying MESS on my projector new [Re: Dullaron]
#330728 - 08/27/14 10:59 AM


> > Tried it on my projector at about 90" diagonal.
> >
> > Looks good in the picture! Maybe we do need some kind of bloom effect in the
> shader.
>
> Nice. I downloaded the update files. Thanks.

OK

Just to be clear, there are no new features in the shader. I mentioned "bloom" because the camera caused some bloom in the photo and it made me think maybe bloom should be added as a feature. I don't think any CRT shaders for sdlmame/sdlmess support bloom right now. The HLSL system does for standard mame though.



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Trying MESS on my projector new [Re: SoltanGris42]
#330731 - 08/27/14 12:32 PM


> > > Tried it on my projector at about 90" diagonal.
> > >
> > > Looks good in the picture! Maybe we do need some kind of bloom effect in the
> > shader.
> >
> > Nice. I downloaded the update files. Thanks.
>
> OK
>
> Just to be clear, there are no new features in the shader. I mentioned "bloom"
> because the camera caused some bloom in the photo and it made me think maybe bloom
> should be added as a feature. I don't think any CRT shaders for sdlmame/sdlmess
> support bloom right now. The HLSL system does for standard mame though.

OK I won't worry about the bloom.



Windows 10 Pro 64-bit / Intel Core i5-4460 3.20 GHz / 8.00 GB RAM / AMD Radeon R9 200 Series
http://us.battle.net/d3/en/profile/Dunard-1884/
https://sites.google.com/site/o0kinghanco0o/mame_building_info (Updated on the 07/18/2017 at 9:49 PM.)



TimothyLottes
MAME Fan
Reged: 08/27/14
Posts: 1
Send PM


Re: Tried to get Timothy Lottes CRT Shader working with SDLMAME. new [Re: SoltanGris42]
#330748 - 08/27/14 06:46 PM


Thanks for integrating the shader!

I tossed up an example which has a small amount of scanline bloom added,

https://www.shadertoy.com/view/MsjXzh

The aperture grill is definitely a compromise right now. I found that for 1920x1080 displays I liked the grill fixed to output pixels instead of getting warped, because there just is not enough pixels per grill element to do a good proper simulation if a real pattern. Reason why it is rotated 90 degrees, less chromatic issues on the scanlines.

Grill should definitely be a loadable option with warp/no-warp check-box, but could not do loadable image in shadertoy. Perhaps if I get time I will try a few more options: like trinitron, vga dot pattern, etc...



lamprey
MAME Fan
Reged: 12/01/11
Posts: 238
Send PM


Re: Tried to get Timothy Lottes CRT Shader working with SDLMAME. new [Re: MooglyGuy]
#330768 - 08/27/14 10:50 PM


> What I would very much like is to eventually make the HLSL code in MAME/MESS generate
> the aperture grille effect at the highest resolution possible, then do a
> gamma-correct downsample to avoid the horrible colored stripe effect you get when you
> crank the aperture grille intensity up. Ideally that would give both a proper
> physical modelling of the aperture grille as well as avoid color beating, but that'd
> take more time than I'm up for putting in at the moment.

That would be awesome. Hopefully, you can free up some time in the near future!



lamprey
MAME Fan
Reged: 12/01/11
Posts: 238
Send PM


Re: Tried to get Timothy Lottes CRT Shader working with SDLMAME. new [Re: bigbluefe]
#330769 - 08/27/14 11:03 PM


> Holy cow. This shader looks amazing.
>
> I used Haze's SDLMAME build, and it seems like SDLMAME in Windows has way more audio
> latency than the Windows MAME. Can anything be done about that?
>
> Also, for some reason, SDLMAME in Windows doesn't seem to work correctly with G-Sync.
> I get choppiness in it, but Windows MAME is fine.

I wish I knew more about SDL to see if I could overcome the issues I have. Unfortunately, I had to give up on it due to the audio issues and the cursor it puts on my screen when launching. Still hopeful that I can get around this someday.

Not sure if this will work for you, but it has been suggested to use one of the Frame Skip (F9) setting values (use F11 to see the setting value) to get around the stuttering/poping sound. Additionally, you might try disabling waitvsync if you have it enabled. I tried everything, I could think of and still get pretty bad sound in certain games, like DKong. Not sure if it is a symptom of my low refresh rate or what, but like you I don't have any (these) issues with MAME itself.



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


By the way. new [Re: lamprey]
#330770 - 08/27/14 11:47 PM


Some games will have graphics issue when the GLSL turn on. I found a work around the graphics issue. The trick is to turn up the brightness to fix the graphics issue. You can turn it back down after it fix the graphics issue.

This issue might be fix after the 2.0.3 (stable) added. 1.2.15 have some bugs.

Just giving you an head up.



Windows 10 Pro 64-bit / Intel Core i5-4460 3.20 GHz / 8.00 GB RAM / AMD Radeon R9 200 Series
http://us.battle.net/d3/en/profile/Dunard-1884/
https://sites.google.com/site/o0kinghanco0o/mame_building_info (Updated on the 07/18/2017 at 9:49 PM.)



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Updated the shader file to work with my laptop's Intel Graphics driver new [Re: SoltanGris42]
#330795 - 08/28/14 06:40 AM


> Intel's driver doesn't like type casting, so the filter wouldn't compile on my laptop
> with Intel graphics.
>
> Now it should work.
>
> I think that some Linux drivers (especially from intel) are even pickier. So who
> knows if it works there without additional modifications. I don't have linux outside
> of a VM any more, so I can't test it...
>
> I'm updating the original post with the updated version too. There shouldn't be any
> reason for the older one to exist.
>
> This version is slightly different. It's slightly better organized (the stuff I
> added...), the defaults are more sensible (not as much saturation boost, not quite as
> sharp), and of course my laptop likes the fragment shader now.

You ported this over or Timothy Lottes did?

I would like to add this to here. https://sites.google.com/site/o0kinghanco0o/crt-geom-alternative-downloads

Before doing so I needed to know.



Windows 10 Pro 64-bit / Intel Core i5-4460 3.20 GHz / 8.00 GB RAM / AMD Radeon R9 200 Series
http://us.battle.net/d3/en/profile/Dunard-1884/
https://sites.google.com/site/o0kinghanco0o/mame_building_info (Updated on the 07/18/2017 at 9:49 PM.)



R. Belmont
Cuckoo for Konami
Reged: 09/21/03
Posts: 9605
Loc: ECV-197 The Orville
Send PM


Re: Updated the shader file to work with my laptop's Intel Graphics driver new [Re: SoltanGris42]
#330811 - 08/28/14 05:21 PM


> I think that some Linux drivers (especially from intel) are even pickier. So who
> knows if it works there without additional modifications. I don't have linux outside
> of a VM any more, so I can't test it...

The original shader file worked fine on Linux for me (GeForce GTX780, Nvidia ForceWare 331.78) with the exception that it wouldn't display the graphics overlay in firefox where CRT-geom and NTSC would.

Edited by R. Belmont (08/28/14 05:22 PM)



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Tried to get Timothy Lottes CRT Shader working with SDLMAME. new [Re: TimothyLottes]
#330827 - 08/29/14 12:42 AM


> Thanks for integrating the shader!
>
> I tossed up an example which has a small amount of scanline bloom added,
>
> https://www.shadertoy.com/view/MsjXzh
>
> The aperture grill is definitely a compromise right now. I found that for 1920x1080
> displays I liked the grill fixed to output pixels instead of getting warped, because
> there just is not enough pixels per grill element to do a good proper simulation if a
> real pattern. Reason why it is rotated 90 degrees, less chromatic issues on the
> scanlines.
>
> Grill should definitely be a loadable option with warp/no-warp check-box, but could
> not do loadable image in shadertoy. Perhaps if I get time I will try a few more
> options: like trinitron, vga dot pattern, etc...

Cool



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Re: Updated the shader file to work with my laptop's Intel Graphics driver new [Re: R. Belmont]
#330832 - 08/29/14 03:55 AM


> > I think that some Linux drivers (especially from intel) are even pickier. So who
> > knows if it works there without additional modifications. I don't have linux
> outside
> > of a VM any more, so I can't test it...
>
> The original shader file worked fine on Linux for me (GeForce GTX780, Nvidia
> ForceWare 331.78) with the exception that it wouldn't display the graphics overlay in
> firefox where CRT-geom and NTSC would.

Okay. I'll try to figure out why that happens with firefox Just need the ginormous chd.

I'll add the bloom stuff from the current version on shadertoy too. But I can't quite figure out the best way to do it. If you add it the easiest way (directly as written), then systems with large texture resolutions get less bloom. And then if you make the effect wider to compensate, you get a hard edge at the edge of the glow. And if the system is lopsided that way like tg16 (pixel aspect: 544x121?) then the bloom is similarly disproportionate.

So I'll see if I can figure that out too. Either way, I'll post what I have tomorrow probably, if I can get that chd.



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Re: Updated the shader file to work with my laptop's Intel Graphics driver new [Re: Dullaron]
#330834 - 08/29/14 04:02 AM


> > Intel's driver doesn't like type casting, so the filter wouldn't compile on my
> laptop
> > with Intel graphics.
> >
> > Now it should work.
> >
> > I think that some Linux drivers (especially from intel) are even pickier. So who
> > knows if it works there without additional modifications. I don't have linux
> outside
> > of a VM any more, so I can't test it...
> >
> > I'm updating the original post with the updated version too. There shouldn't be any
> > reason for the older one to exist.
> >
> > This version is slightly different. It's slightly better organized (the stuff I
> > added...), the defaults are more sensible (not as much saturation boost, not quite
> as
> > sharp), and of course my laptop likes the fragment shader now.
>
> You ported this over or Timothy Lottes did?
>
> I would like to add this to here.
> https://sites.google.com/site/o0kinghanco0o/crt-geom-alternative-downloads
>
> Before doing so I needed to know.

Timothy Lottes wrote the whole thing. I added a couple of easy extras like the saturation/tint stuff + contrast boost. But basically I just fudged his work to make it work with what the GLSL system provides to shader.

But don't put it up anywhere right now. The bloom stuff will be added tomorrow probably and hopefully I can figure out the firefox overlay thing R.Belmont mentioned above. So you should wait until then at least.



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Updated the shader file to work with my laptop's Intel Graphics driver new [Re: SoltanGris42]
#330849 - 08/29/14 07:39 AM


> > > Intel's driver doesn't like type casting, so the filter wouldn't compile on my
> > laptop
> > > with Intel graphics.
> > >
> > > Now it should work.
> > >
> > > I think that some Linux drivers (especially from intel) are even pickier. So who
> > > knows if it works there without additional modifications. I don't have linux
> > outside
> > > of a VM any more, so I can't test it...
> > >
> > > I'm updating the original post with the updated version too. There shouldn't be
> any
> > > reason for the older one to exist.
> > >
> > > This version is slightly different. It's slightly better organized (the stuff I
> > > added...), the defaults are more sensible (not as much saturation boost, not
> quite
> > as
> > > sharp), and of course my laptop likes the fragment shader now.
> >
> > You ported this over or Timothy Lottes did?
> >
> > I would like to add this to here.
> > https://sites.google.com/site/o0kinghanco0o/crt-geom-alternative-downloads
> >
> > Before doing so I needed to know.
>
> Timothy Lottes wrote the whole thing. I added a couple of easy extras like the
> saturation/tint stuff + contrast boost. But basically I just fudged his work to make
> it work with what the GLSL system provides to shader.
>
> But don't put it up anywhere right now. The bloom stuff will be added tomorrow
> probably and hopefully I can figure out the firefox overlay thing R.Belmont mentioned
> above. So you should wait until then at least.

I took it off.



MooglyGuy
Renegade MAME Dev
Reged: 09/01/05
Posts: 1646
Send PM


Re: Tried to get Timothy Lottes CRT Shader working with SDLMAME. new [Re: TimothyLottes]
#330857 - 08/29/14 11:14 AM


> Thanks for integrating the shader!
>
> I tossed up an example which has a small amount of scanline bloom added,
>
> https://www.shadertoy.com/view/MsjXzh

Looks cool! In practice it might be better to apply the bloom by box-blurring successive steps downward and then rendering them all on top of each other, as on a real CRT any bloom you see is likely to be due to the light diffusing through the CRT glass. I understand that that's not practical to do on Shadertoy since you can't define render targets, but in an actual implementation it might be worth trying.

As for the aperture grille, it's the same sort of thing - it should be possible to render to a high-res offscreen target and then do a gamma-correct downsample to avoid any ugly color banding from the grille texture.



R. Belmont
Cuckoo for Konami
Reged: 09/21/03
Posts: 9605
Loc: ECV-197 The Orville
Send PM


Re: Updated the shader file to work with my laptop's Intel Graphics driver new [Re: SoltanGris42]
#330869 - 08/29/14 08:06 PM


> > > I think that some Linux drivers (especially from intel) are even pickier. So who
> > > knows if it works there without additional modifications. I don't have linux
> > outside
> > > of a VM any more, so I can't test it...
> >
> > The original shader file worked fine on Linux for me (GeForce GTX780, Nvidia
> > ForceWare 331.78) with the exception that it wouldn't display the graphics overlay
> in
> > firefox where CRT-geom and NTSC would.
>
> Okay. I'll try to figure out why that happens with firefox Just need the ginormous
> chd.

Just to clarify: the video layer doesn't render at all with any -video opengl at the moment, that's not the fault of any specific shader. (Contrary to months of libel and slander by Dullaron, -video soft works great with all laserdisc games). But you should see the graphics layer.

Edited by R. Belmont (08/29/14 08:07 PM)



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Updated again with a small bloom effect and 2 alternate shadow mask patterns new [Re: SoltanGris42]
#330912 - 08/30/14 04:06 AM Attachment: Lottes_CRT_Shader_Updated_Again_With_Bloom.zip 4 KB (51 downloads)


Updated again with some of the stuff in the newer version posted on shadertoy: http://www.shadertoy.com/view/MsjXzh

There is now a bloom effect. But don't get too excited. It uses a low radius blur. To match what you would see in other shaders we would need to blur across many more pixels. That's very slow. A solution is to use a weighted average of a series of downsampled images to approximate a large radius blur. That's what the HLSL shader does and it works great. But we can't do that in the GLSL system right now.

Anyway, the effect is turned up enough to see the effect on, for example, the super metroid title screen. It's easy enough to lower the setting in the shader.

Also, there are now 3 options for the shadow mask effect: "VGA Monitor", "TV", "Aperture Grill". You can pick one in the shader. I like the TV version the best, so it's enabled by default.

Lastly, we're close to the max length of a glsl shader, so I moved the YUV pre-calculations to the vertex shader. So you need to set saturation and tint in that file now...

Oh, and I set alpha to 1.0 now. Maybe that solves the graphics layer issue with firefox? I'm an optimist and I don't have a better idea right now (and also can't make it run in sdlmame to check)

Edited by SoltanGris42 (08/30/14 04:21 AM)



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Re: Updated again with a small bloom effect and 2 alternate shadow mask patterns new [Re: SoltanGris42]
#330914 - 08/30/14 04:21 AM Attachment: Lottes_CRT_Shader_Small_Bloom.jpg 984 KB (14 downloads)


Obligatory Super Metroid screenshot a la http://filthypants.blogspot.com/2012/07/customizing-cgwgs-crt-pixel-shader.html

[ATTACHED IMAGE - CLICK FOR FULL SIZE]

Attachment



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Updated again with a small bloom effect and 2 alternate shadow mask patterns new [Re: SoltanGris42]
#330915 - 08/30/14 05:46 AM


> Updated again with some of the stuff in the newer version posted on shadertoy:
> http://www.shadertoy.com/view/MsjXzh
>
> There is now a bloom effect. But don't get too excited. It uses a low radius blur. To
> match what you would see in other shaders we would need to blur across many more
> pixels. That's very slow. A solution is to use a weighted average of a series of
> downsampled images to approximate a large radius blur. That's what the HLSL shader
> does and it works great. But we can't do that in the GLSL system right now.
>
> Anyway, the effect is turned up enough to see the effect on, for example, the super
> metroid title screen. It's easy enough to lower the setting in the shader.
>
> Also, there are now 3 options for the shadow mask effect: "VGA Monitor", "TV",
> "Aperture Grill". You can pick one in the shader. I like the TV version the best, so
> it's enabled by default.
>
> Lastly, we're close to the max length of a glsl shader, so I moved the YUV
> pre-calculations to the vertex shader. So you need to set saturation and tint in that
> file now...
>
> Oh, and I set alpha to 1.0 now. Maybe that solves the graphics layer issue with
> firefox? I'm an optimist and I don't have a better idea right now (and also can't
> make it run in sdlmame to check)

Missing the cornersize. Rounded off the four points into rounded corners. Like the old TVs had back then. Only thing missing. Find it in the CRT-geom-20120130 but I have no idea how to port that over onto Lottes_CRT. What I'm saying is I don't know which part of coding to use. Can't port that part over then don't worry about it.

So far I like this.



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Re: Updated again with a small bloom effect and 2 alternate shadow mask patterns new [Re: Dullaron]
#330917 - 08/30/14 06:17 AM


> Missing the cornersize. Rounded off the four points into rounded corners. Like the
> old TVs had back then. Only thing missing. Find it in the CRT-geom-20120130 but I
> have no idea how to port that over onto Lottes_CRT. What I'm saying is I don't know
> which part of coding to use. Can't port that part over then don't worry about it.
>
> So far I like this.

Well, so far it's almost all just stuff that Timothy Lottes had in his shader. I didn't want to fill it with stuff from all of the other CRT shaders. Especially not at first.

If it sticks around in the same state for a while, I'll take a shot at optimizing it a bit for speed/space. Then down the line extra features can be added. Not that I'm in charge of this or anything. It's not my shader and it's in the public domain. So anybody can add whatever they want...

But it would probably be easy to rip out the shadow mask effect from this and replace the one in the CRT-geom shader to get everything you want...



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Updated again with a small bloom effect and 2 alternate shadow mask patterns new [Re: SoltanGris42]
#330918 - 08/30/14 06:28 AM


> > Missing the cornersize. Rounded off the four points into rounded corners. Like the
> > old TVs had back then. Only thing missing. Find it in the CRT-geom-20120130 but I
> > have no idea how to port that over onto Lottes_CRT. What I'm saying is I don't know
> > which part of coding to use. Can't port that part over then don't worry about it.
> >
> > So far I like this.
>
> Well, so far it's almost all just stuff that Timothy Lottes had in his shader. I
> didn't want to fill it with stuff from all of the other CRT shaders. Especially not
> at first.
>
> If it sticks around in the same state for a while, I'll take a shot at optimizing it
> a bit for speed/space. Then down the line extra features can be added. Not that I'm
> in charge of this or anything. It's not my shader and it's in the public domain. So
> anybody can add whatever they want...
>
> But it would probably be easy to rip out the shadow mask effect from this and replace
> the one in the CRT-geom shader to get everything you want...

Let see what happen next. He might want to continue working on it. I'm not touching anything. Leaving it the way it is.



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Update on Aug 30 - Alpha works now... new [Re: SoltanGris42]
#330946 - 08/30/14 10:06 PM Attachment: Lottes_CRT_Shader_Aug30_AlphaWorks.zip 4 KB (83 downloads)


This should fix games like Golly! Ghost! or others that need alpha passed through.

Also added a parameter to adjust the strength of the shadow mask effect.



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Update on Aug 30 - Alpha works now... new [Re: SoltanGris42]
#330952 - 08/31/14 01:53 AM


> This should fix games like Golly! Ghost! or others that need alpha passed through.
>
> Also added a parameter to adjust the strength of the shadow mask effect.

Just tried invaders out with the artwork. There is a little bit of slowdown. Still playable. I guest too much shrinking lines and patterns is causes the slowdown.

Edit: OK the screen gotta be turn on it side to stop the slowdown. Run fine after that.



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Re: Update on Aug 30 - Alpha works now... new [Re: Dullaron]
#330954 - 08/31/14 02:06 AM


> > This should fix games like Golly! Ghost! or others that need alpha passed through.
> >
> > Also added a parameter to adjust the strength of the shadow mask effect.
>
> Just tried invaders out with the artwork. There is a little bit of slowdown. Still
> playable. I guest too much shrinking lines and patterns is causes the slowdown.
>
> Edit: OK the screen gotta be turn on it side to stop the slowdown. Run fine after
> that.

Well, it fetches the same texture samples multiple times, and evaluates a gaussian kernel at the same point multiple times for every pixel. So I'm going to go ahead and blame slowness on that. It's not fullspeed on my Surface Pro 3 on battery.

With a little free time, I'll move some calculations to the vertex shader so they won't be done for every pixel, and try to minimize texture fetches. That will speed it up a lot. It just involves removing all of the sub-functions that get called, and so I need time to sit down and re-write the whole thing.



CiroConsentino
Frontend freak!
Reged: 09/21/03
Posts: 5542
Loc: Brazil
Send PM


Re: Update on Aug 30 - Alpha works now... new [Re: SoltanGris42]
#330955 - 08/31/14 02:19 AM


Your work on this shader is amazing. Congrats.



Arnold101
MAME Fan
Reged: 09/03/14
Posts: 10
Send PM


Re: Update on Aug 30 - Alpha works now... new [Re: SoltanGris42]
#331142 - 09/03/14 09:04 PM


where i can download snes emulator and psx or others as well with support to this shader? thanks!

Edited by Arnold101 (09/03/14 09:05 PM)



R. Belmont
Cuckoo for Konami
Reged: 09/21/03
Posts: 9605
Loc: ECV-197 The Orville
Send PM


Re: Update on Aug 30 - Alpha works now... new [Re: Arnold101]
#331153 - 09/03/14 10:03 PM


> where i can download snes emulator and psx or others as well with support to this
> shader? thanks!

This shader works with MAME's sister project MESS which emulates SNES and PSX and many others.



Arnold101
MAME Fan
Reged: 09/03/14
Posts: 10
Send PM


Re: Update on Aug 30 - Alpha works now... new [Re: R. Belmont]
#331158 - 09/03/14 10:39 PM


> > where i can download snes emulator and psx or others as well with support to this
> > shader? thanks!
>
> This shader works with MAME's sister project MESS which emulates SNES and PSX and
> many others.

ok but is released? where? thx



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Update on Aug 30 - Alpha works now... new [Re: Arnold101]
#331163 - 09/04/14 12:05 AM


> ok but is released? where? thx

http://mamedev.emulab.it/haze/2014/07/23/ume-0-154/

For Linux go here for the info. http://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=35138#Post35138



Arnold101
MAME Fan
Reged: 09/03/14
Posts: 10
Send PM


Re: Update on Aug 30 - Alpha works now... new [Re: Dullaron]
#331167 - 09/04/14 04:01 AM


> > ok but is released? where? thx
>
> http://mamedev.emulab.it/haze/2014/07/23/ume-0-154/
>
> For Linux go here for the info.
> http://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=35138#Post35138

thanks. how i activate the shader?
the emulator start only in dos full screen no gui like normal mame it is normal?



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Update on Aug 30 - Alpha works now... (Edit.) new [Re: Arnold101]
#331172 - 09/04/14 06:51 AM Attachment: mame and mess.zip 4 KB (25 downloads)


> thanks. how i activate the shader?
> the emulator start only in dos full screen no gui like normal mame it is normal?

Official MAME and MESS share the same gui as the SDL builds.

After you download the files then unzip those into MAME folder or MESS folder or Both.

Here is default settings on the mame.ini and mess.ini.

MAME use mame.ini

MESS use mess.ini

Drop it into your MAME folder or MESS folder or Both.

Open that ini up and find these settings.


Code:


#
# OpenGL-SPECIFIC OPTIONS
#
filter 1
prescale 1
gl_forcepow2texture 0
gl_notexturerect 0
gl_vbo 1
gl_pbo 1
gl_glsl 0
gl_glsl_filter 1
glsl_shader_mame0 none



Now change just two settings.


Code:


#
# OpenGL-SPECIFIC OPTIONS
#
filter 1
prescale 1
gl_forcepow2texture 0
gl_notexturerect 0
gl_vbo 1
gl_pbo 1
gl_glsl 1
gl_glsl_filter 1
glsl_shader_mame0 Lottes_CRT



By the way. Full screen is already set in those ini files.

To turn that off. Find this setting in the OSD VIDEO OPTIONS. Change the 0 to 1.


Code:


window 1



If you want to try out more shaders then here is the link. https://sites.google.com/site/o0kinghanco0o/crt-geom-alternative-downloads

Forgot to post the ini files. Sorry.

Edited by Dullaron (09/04/14 08:38 AM)



Anonymous
Unregistered
Send PM


Re: Update on Aug 30 - Alpha works now... new [Re: Arnold101]
#331179 - 09/04/14 08:27 AM


> the emulator start only in dos full screen no gui like normal mame it is normal?

It sounds like you aren't running "normal" mame.

If you tell us where you download mame from then it might be possible for someone to find out whether there is a version of mess with the same gui.



mac1202
MAME Fan
Reged: 09/04/14
Posts: 1
Send PM


Re: Update on Aug 30 - Alpha works now... new [Re: ]
#331234 - 09/04/14 08:54 PM


Nice work, unfortunately doesn t work with intel chipset under linux i get the following outpout from the terminal :

Code:

src/osd/sdl/gl_shader_tool.c:370: GL Error: object 0x8 compilation 
failed
src/osd/sdl/gl_shader_tool.c:370 glInfoLog: 0:45(17): error:
initializer of const variable `U' must be a constant expression
0:46(17): error: initializer of const variable `W' must be a
constant expression

failed to process shader:



Arnold101
MAME Fan
Reged: 09/03/14
Posts: 10
Send PM


Re: Update on Aug 30 - Alpha works now... (Edit.) new [Re: Dullaron]
#331235 - 09/04/14 09:09 PM


> > thanks. how i activate the shader?
> > the emulator start only in dos full screen no gui like normal mame it is normal?
>
> Official MAME and MESS share the same gui as the SDL builds.
>
> After you download the files then unzip those into MAME folder or MESS folder or
> Both.
>
> Here is default settings on the mame.ini and mess.ini.
>
> MAME use mame.ini
>
> MESS use mess.ini
>
> Drop it into your MAME folder or MESS folder or Both.
>
> Open that ini up and find these settings.
>
>
> #
> # OpenGL-SPECIFIC OPTIONS
> #
> filter 1
> prescale 1
> gl_forcepow2texture 0
> gl_notexturerect 0
> gl_vbo 1
> gl_pbo 1
> gl_glsl 0
> gl_glsl_filter 1
> glsl_shader_mame0 none
>
>
> Now change just two settings.
>
>
> #
> # OpenGL-SPECIFIC OPTIONS
> #
> filter 1
> prescale 1
> gl_forcepow2texture 0
> gl_notexturerect 0
> gl_vbo 1
> gl_pbo 1
> gl_glsl 1
> gl_glsl_filter 1
> glsl_shader_mame0 Lottes_CRT
>
>
> By the way. Full screen is already set in those ini files.
>
> To turn that off. Find this setting in the OSD VIDEO OPTIONS. Change the 0 to 1.
>
>
> window 1
>
>
> If you want to try out more shaders then here is the link.
> https://sites.google.com/site/o0kinghanco0o/crt-geom-alternative-downloads
>
> Forgot to post the ini files. Sorry.

downloaded your ini, but i don't have the shader posted in this thread, is included in the mess you linked from that site? i have downloaded and installed that one.

or i have to download the shader?



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Re: Update on Aug 30 - Alpha works now... new [Re: mac1202]
#331238 - 09/04/14 11:29 PM


> Nice work, unfortunately doesn t work with intel chipset under linux i get the
> following outpout from the terminal :
> src/osd/sdl/gl_shader_tool.c GL Error: object 0x8 compilation
> failed
> src/osd/sdl/gl_shader_tool.c:370 glInfoLog: 0:45(17): error:
> initializer of const variable `U' must be a constant expression
> 0:46(17): error: initializer of const variable `W' must be a
> constant expression
>
> failed to process shader:
Yeah. The linux intel drivers have a shader compiler that complains about everything. I think it might not work with the CRT-geom shader either without changes.

It's only hard to fix right now because the shader works fine with the intel's windows drivers and I haven't checked into running linux natively on my Surface Pro 3 (the only thing I have with intel graphics) because the hardware isn't well supported in linux right now.

But I'll try to get it figured out and fix it when I have some free time.



Arnold101
MAME Fan
Reged: 09/03/14
Posts: 10
Send PM


Re: Update on Aug 30 - Alpha works now... new [Re: SoltanGris42]
#331251 - 09/05/14 03:06 AM


soltan you read pm but don't reply why?...i have not understood how i use this shader with mess..please explain



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Update on Aug 30 - Alpha works now... (Edit.) new [Re: Arnold101]
#331254 - 09/05/14 03:21 AM


> downloaded your ini, but i don't have the shader posted in this thread, is included
> in the mess you linked from that site? i have downloaded and installed that one.
>
> or i have to download the shader?

Dev will not included those with the builds. You must download the shader pack and then unzip those files into the folder.



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Re: Update on Aug 30 - Alpha works now... new [Re: Arnold101]
#331257 - 09/05/14 03:59 AM


> soltan you read pm but don't reply why?...i have not understood how i use this shader
> with mess..please explain

I read you pm. But then I looked in this thread and I saw that Dullaron explained it pretty well.

There are three things you need to do.

1) Use SDLMame or SDLMess. The regular builds can't use GLSL shaders. The easiest place to get these is probably Haze's website because SDL Windows builds aren't offically supported: http://mamedev.emulab.it/haze/2014/07/23/ume-0-154/

2) Download and unzip the shader files some place. Maybe in a subfolder called "glsl" or "shaders" in your mame/mess folder...

3) Edit your mame.ini or mess.ini to use the shader. Dullaron showed you how. You need to specifically enable glsl shaders with these settings set:

Code:


video opengl
gl_glsl 1


and set the emulator to use the shader:

Code:

glsl_shader_mame0         C:\path\to\the\Lottes_CRT



And if you're new to mame/mess there are a lot of other settings you might want to set. Like maybe use vsync/syncrefresh/refreshspeed and disable throttle so you get rid of screen tearing. But all of that stuff is normal mame/mess stuff that has nothing to do with glsl shaders.

I don't use a frontend with mame/mess so I can't help you configure any of those.



Arnold101
MAME Fan
Reged: 09/03/14
Posts: 10
Send PM


Re: Update on Aug 30 - Alpha works now... (Edit.) new [Re: Dullaron]
#331258 - 09/05/14 04:37 AM


> > downloaded your ini, but i don't have the shader posted in this thread, is included
> > in the mess you linked from that site? i have downloaded and installed that one.
> >
> > or i have to download the shader?
>
> Dev will not included those with the builds. You must download the shader pack and
> then unzip those files into the folder.
thanks and soltan too i have not noticed the shader attached at first post...in the zip there are 2 files, what change in these 2?

i have downloaded from the link posted the UME..is the same thing as MESS? i prefer a gui version, where i can find it? thanks a lot



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Update on Aug 30 - Alpha works now... (Edit.) new [Re: Arnold101]
#331260 - 09/05/14 04:59 AM


> > > downloaded your ini, but i don't have the shader posted in this thread, is
> included
> > > in the mess you linked from that site? i have downloaded and installed that one.
> > >
> > > or i have to download the shader?
> >
> > Dev will not included those with the builds. You must download the shader pack and
> > then unzip those files into the folder.
> thanks and soltan too i have not noticed the shader attached at first post...in the
> zip there are 2 files, what change in these 2?
>
> i have downloaded from the link posted the UME..is the same thing as MESS? i prefer a
> gui version, where i can find it? thanks a lot

Oh the MAMEUI and MESSUI. There aren't any in SDL. Use a frontend such as http://qmc2.arcadehits.net/wordpress/ It a good one. Just take a while get use to it.

By the way. I forgot to tell you to turn on the Opengl.

#
# OSD VIDEO OPTIONS
#
video opengl



Arnold101
MAME Fan
Reged: 09/03/14
Posts: 10
Send PM


Re: Update on Aug 30 - Alpha works now... (Edit.) new [Re: Dullaron]
#331281 - 09/05/14 01:53 PM


thanks so that universal machine emulator what it is?

i try soon to get working mess with shader.



bigbluefe
MAME Fan
Reged: 02/18/14
Posts: 91
Send PM


Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME. new [Re: SoltanGris42]
#331777 - 09/15/14 02:24 AM


Out of curiosity, have you tried this shader in MESS with Earthworm Jim for the Genesis?

For some reason, this particular game (other Genesis games seem okay, oddly enough) gets completely butchered in the ahader.



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME. new [Re: bigbluefe]
#331779 - 09/15/14 02:45 AM


> Out of curiosity, have you tried this shader in MESS with Earthworm Jim for the
> Genesis?
>
> For some reason, this particular game (other Genesis games seem okay, oddly enough)
> gets completely butchered in the ahader.

Are you talking about the corrupted graphics? Bright it up a few times to get rid of the corrupted graphics and then put the brightness back where it was in SDLMESS. Also works in SDLMAME too. Just weird.



B2K24
MAME @ 15 kHz Sony Trinitron CRT user
Reged: 10/25/10
Posts: 2546
Send PM


Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME. new [Re: bigbluefe]
#331782 - 09/15/14 03:12 AM


> Out of curiosity, have you tried this shader in MESS with Earthworm Jim for the
> Genesis?
>
> For some reason, this particular game (other Genesis games seem okay, oddly enough)
> gets completely butchered in the ahader.

I get the same result here. It seems the same behavior also occurs in cvaniau [Castlevania - Bloodlines (USA)]



R. Belmont
Cuckoo for Konami
Reged: 09/21/03
Posts: 9605
Loc: ECV-197 The Orville
Send PM


Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME. new [Re: B2K24]
#331785 - 09/15/14 04:15 AM


> I get the same result here. It seems the same behavior also occurs in cvaniau
> [Castlevania - Bloodlines (USA)]

Bloodlines has problems with GLSL in general, which I don't entirely understand. The only functional OpenGL debugger out there[1] currently requires Ubuntu on hardware (not virtualized) with an accelerated card, which puts a crimp in my ability to see what's going on.

[1] Valve's VOGL. AMD offers a Windows OGL debugger which does nothing worthwhile when you run it against MAME, possibly because I have an NVidia card.

Edited by R. Belmont (09/15/14 04:17 AM)



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


EDITED: Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME new [Re: R. Belmont]
#331788 - 09/15/14 04:36 AM Attachment: cvaniau_bug.jpg 870 KB (14 downloads)


> > I get the same result here. It seems the same behavior also occurs in cvaniau
> > [Castlevania - Bloodlines (USA)]
>
> Bloodlines has problems with GLSL in general, which I don't entirely understand. The
> only functional OpenGL debugger out there[1] currently requires Ubuntu on hardware
> (not virtualized) with an accelerated card, which puts a crimp in my ability to see
> what's going on.
>
> [1] Valve's VOGL. AMD offers a Windows OGL debugger which does nothing worthwhile
> when you run it against MAME, possibly because I have an NVidia card.

Dullaron is right. Don't know how he figured this out!, but touching the brightness slider (and only that one!) fixes the graphical corruption in both of these games.

EDIT: Earthworm Jim is also a (the same) general GLSL shader error. CRT-geom does exactly the same thing. I was initially worried that it was a problem with this specific shader because I had a similar (same?) issue when I started porting the shader. If I recall correctly, it was an issue between using the "color_texture_sz" or "color_texture_pow2_sz" uniforms. I had to use one when I thought it should have been the other.

EDIT AGAIN:
Before touching brightness, MESS says that the video resolution is 256x224 and after touching brightness (with MESS paused so the system didn't change resolutions) it says 320x224.

I feel like MESS is initially copying a 320x224 texture into a 256x224 texture and then giving that to the GLSL system. And so we get missing columns. And here's what you get with "mess -v" if you don't touch the brightness:

The EDITS never stop!
If you resample the 320x256 screenshot to 256x224 with point resizing, then you get exactly the same missing columns that are missing in the screen below. So I think my last edit is pretty close to what is going on.


Code:


GL texture: copy 0, shader 1, dynamic 0, 256x224 256x224 [RGB32, Equal: 1, Palet
te: 0,
scale 1x1, border 0, pitch 512,256/16384], bytes/pix 4
GL texture: copy 0, shader 1, dynamic 0, 320x224 320x224 [RGB32, Equal: 1, Palet
te: 0,
scale 1x1, border 0, pitch 480,320/16384], bytes/pix 4
GL texture: copy 0, shader 1, dynamic 0, 320x224 320x224 [RGB32, Equal: 1, Palet
te: 0,
scale 1x1, border 0, pitch 480,320/16384], bytes/pix 4
GL texture: copy 0, shader 1, dynamic 0, 256x224 256x224 [RGB32, Equal: 1, Palet
te: 0,
scale 1x1, border 0, pitch 480,256/16384], bytes/pix 4
GL texture: copy 0, shader 1, dynamic 0, 256x224 256x224 [RGB32, Equal: 1, Palet
te: 0,
scale 1x1, border 0, pitch 480,256/16384], bytes/pix 4



Touch the brightness and you get a new 320x224 texture and the corruption is gone:

Code:


GL texture: copy 0, shader 1, dynamic 0, 256x224 256x224 [RGB32, Equal: 1, Palet
te: 0,
scale 1x1, border 0, pitch 512,256/16384], bytes/pix 4
GL texture: copy 0, shader 1, dynamic 0, 320x224 320x224 [RGB32, Equal: 1, Palet
te: 0,
scale 1x1, border 0, pitch 480,320/16384], bytes/pix 4
GL texture: copy 0, shader 1, dynamic 0, 320x224 320x224 [RGB32, Equal: 1, Palet
te: 0,
scale 1x1, border 0, pitch 480,320/16384], bytes/pix 4
GL texture: copy 0, shader 1, dynamic 0, 256x224 256x224 [RGB32, Equal: 1, Palet
te: 0,
scale 1x1, border 0, pitch 480,256/16384], bytes/pix 4
GL texture: copy 0, shader 1, dynamic 0, 256x224 256x224 [RGB32, Equal: 1, Palet
te: 0,
scale 1x1, border 0, pitch 480,256/16384], bytes/pix 4
GL texture: copy 1, shader 1, dynamic 0, 320x224 320x224 [RGB32_PALETTED, Equal:
1, Palette: 1,
scale 1x1, border 0, pitch 480,320/16384], bytes/pix 4



Didn't there used to be a problem with changing resolutions and GLSL? Was it fixed for all texture types?

[ATTACHED IMAGE - CLICK FOR FULL SIZE]

Attachment



Dullaron
Diablo III - Dunard #1884
Reged: 07/22/05
Posts: 5732
Loc: Fort Worth, Tx
Send PM


Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME. new [Re: SoltanGris42]
#331789 - 09/15/14 05:09 AM


> > > I get the same result here. It seems the same behavior also occurs in cvaniau
> > > [Castlevania - Bloodlines (USA)]
> >
> > Bloodlines has problems with GLSL in general, which I don't entirely understand.
> The
> > only functional OpenGL debugger out there[1] currently requires Ubuntu on hardware
> > (not virtualized) with an accelerated card, which puts a crimp in my ability to see
> > what's going on.
> >
> > [1] Valve's VOGL. AMD offers a Windows OGL debugger which does nothing worthwhile
> > when you run it against MAME, possibly because I have an NVidia card.
>
> Dullaron is right. Don't know how he figured this out!, but touching the brightness
> slider (and only that one!) fixes the graphical corruption in both of these games.
>
> EDIT: Earthworm Jim is also a general GLSL shader error. CRT-geom does exactly the
> same thing.

I was messing the brightness one day to see what the screen is doing when I saw the corrupted screen. That when I notice it fix the issue.



B2K24
MAME @ 15 kHz Sony Trinitron CRT user
Reged: 10/25/10
Posts: 2546
Send PM


Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME. new [Re: Dullaron]
#331790 - 09/15/14 05:25 AM


Nice one Dullaron

@bigbluefe, I saw your message right after you quit and left the channel. Thanks for the tip about the sleep setting. I set mine now to 0



bigbluefe
MAME Fan
Reged: 02/18/14
Posts: 91
Send PM


Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME. new [Re: B2K24]
#331794 - 09/15/14 03:17 PM


@B2K24 Have you noticed that SDLMAME for Windows seems to drop a frame every once in a while? I'm trying to determine whether it's my computer or something else. Windows MAME doesn't behave that way for me. It'll just periodically bounce from 94% speed to 101% speed back to 100% every couple of minutes. It's not a matter of my computer being too slow, either, because if you unthrottle games they go at 200%+ speed.

Update: I see what it is now. SDLMAME in Windows is really sensitive to the other programs that are running at the same time. If you have Firefox in the background with some Youtube videos or something, it seems to suck away resources from SDLMAME. Windows MAME seems really resilient to this...I wonder if it runs with a higher priority than SDLMAME somehow.

Edited by bigbluefe (09/15/14 03:46 PM)



R. Belmont
Cuckoo for Konami
Reged: 09/21/03
Posts: 9605
Loc: ECV-197 The Orville
Send PM


Re: EDITED: Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME new [Re: SoltanGris42]
#331799 - 09/15/14 04:50 PM


> EDIT AGAIN:
> Before touching brightness, MESS says that the video resolution is 256x224 and after
> touching brightness (with MESS paused so the system didn't change resolutions) it
> says 320x224.

Odd. I'll take a look. On my system I get a 320x224 window with only 256 pixels present, not any corruption.



lamprey
MAME Fan
Reged: 12/01/11
Posts: 238
Send PM


Re: EDITED: Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME new [Re: R. Belmont]
#331808 - 09/15/14 07:42 PM


I'm still holding out some hope that 2.0 SDL shaders will enable me to use SDLMame. But, while playing with this shader I also noticed problems with certain games like Toobin and Crater Raider. It might just be the resolution they run at, but this shader doesn't seem to look very good with them. Or maybe I need to tweak some of the shader settings for those games, which I haven't done.



B2K24
MAME @ 15 kHz Sony Trinitron CRT user
Reged: 10/25/10
Posts: 2546
Send PM


Re: EDITED: Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME new [Re: lamprey]
#331809 - 09/15/14 08:09 PM


> I'm still holding out some hope that 2.0 SDL shaders will enable me to use SDLMame.
> But, while playing with this shader I also noticed problems with certain games like
> Toobin and Crater Raider. It might just be the resolution they run at, but this
> shader doesn't seem to look very good with them. Or maybe I need to tweak some of the
> shader settings for those games, which I haven't done.

With vertical games, I've found that the CRT-geom shader looks a lot better.

what you can do is make a copy of your mame.ini, rename it to vertical.ini and toss it in the ini directory. You also have the option of naming it either the driver name or set name and it will take effect next time you launch said game to use a different shader. In this case it would be the CRT-geom shader if you had required files and path to filename set correctly.



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Re: EDITED: Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME new [Re: B2K24]
#331810 - 09/15/14 08:27 PM


> > I'm still holding out some hope that 2.0 SDL shaders will enable me to use SDLMame.
> > But, while playing with this shader I also noticed problems with certain games like
> > Toobin and Crater Raider. It might just be the resolution they run at, but this
> > shader doesn't seem to look very good with them. Or maybe I need to tweak some of
> the
> > shader settings for those games, which I haven't done.
>
> With vertical games, I've found that the CRT-geom shader looks a lot better.
>
> what you can do is make a copy of your mame.ini, rename it to vertical.ini and toss
> it in the ini directory. You also have the option of naming it either the driver name
> or set name and it will take effect next time you launch said game to use a different
> shader. In this case it would be the CRT-geom shader if you had required files and
> path to filename set correctly.

Just looked at the vertical game issue. I thought it was just lack of resolution. But that's not it. If you rotate the shadow mask then everything looks fine again. Either I'll have to do separate versions of the shader with a rotated shadow mask patterns, or have the sjader guess if it's vertical/horizontal based on the resolution. Because the shader doesn't know it's going to be rotated and apparently it needs to.



Traso
MAME Fan
Reged: 01/15/13
Posts: 2687
Send PM


Re: EDITED: Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME new [Re: SoltanGris42]
#331818 - 09/16/14 12:55 AM


> Just looked at the vertical game issue. I thought it was just lack of resolution. But that's not it. If you rotate the shadow mask then everything looks fine again. Either I'll have to do separate versions of the shader with a rotated shadow mask patterns, or have the sjader guess if it's vertical/horizontal based on the resolution. Because the shader doesn't know it's going to be rotated and apparently it needs to.


I think baseline knows, which is why the lines are horizontal and vertical, respectively.



Arnold101
MAME Fan
Reged: 09/03/14
Posts: 10
Send PM


Re: EDITED: Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME new [Re: Traso]
#332169 - 09/22/14 07:37 PM


thanks to soltan this shader is miracolous
taking screenshot from mess not work for me at the moment



Edited by Arnold101 (09/23/14 12:07 AM)



B2K24
MAME @ 15 kHz Sony Trinitron CRT user
Reged: 10/25/10
Posts: 2546
Send PM


Re: EDITED: Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME new [Re: SoltanGris42]
#332171 - 09/22/14 08:05 PM


I'm not sure if the fixed vertical version got attached in this thread. They are in the release thread that got locked.



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Re: EDITED: Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME new [Re: B2K24]
#332176 - 09/22/14 10:42 PM Attachment: Lottes_CRT_VERT_SEP_10.zip 7 KB (83 downloads)


> I'm not sure if the fixed vertical version got attached in this thread. They are in
> the release thread that got locked.

You're right. Here it is again.

For others: there is now an option to rotate the shadow mask patterns. This is (only) useful when you display vertical games in MAME on a standard landscape orientation LCD.

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.



Traso
MAME Fan
Reged: 01/15/13
Posts: 2687
Send PM


Re: EDITED: Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME new [Re: Arnold101]
#332202 - 09/23/14 06:56 AM


> thanks to soltan this shader is miracolous
> taking screenshot from mess not work for me at the moment


Con-fucking-tabulous. What monitor is that on?



Arnold101
MAME Fan
Reged: 09/03/14
Posts: 10
Send PM


Re: EDITED: Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME new [Re: Traso]
#332258 - 09/24/14 08:07 PM


lcd samsung 40" hd ready...seems like a real crt?



MooglyGuy
Renegade MAME Dev
Reged: 09/01/05
Posts: 1646
Send PM


Taking a poll new [Re: SoltanGris42]
#332264 - 09/25/14 12:15 AM


Since everyone seems to be going apeshit over this inaccurate "modelling" of a CRT, I figured I'd take a poll:


Should I remove HLSL from MAME
Yes
No

View the results for this poll




Sune
Connected
Reged: 09/21/03
Posts: 5520
Loc: Lagoa Santa, Brasil
Send PM


Re: Taking a poll new [Re: MooglyGuy]
#332265 - 09/25/14 01:30 AM


> Since everyone seems to be going apeshit over this inaccurate "modelling" of a CRT, I
> figured I'd take a poll:
>
>
> Should I remove HLSL from MAME
> Yes
> No

Of course not, HLSL is the shit. Also, what, 7 people, that's nowhere near "everyone".

Kids love new toys. 7 people playing with lottery shaders has nothing to do with HLSL.

S



Arnold101
MAME Fan
Reged: 09/03/14
Posts: 10
Send PM


Re: Taking a poll new [Re: MooglyGuy]
#332266 - 09/25/14 01:31 AM


> Since everyone seems to be going apeshit over this inaccurate "modelling" of a CRT, I
> figured I'd take a poll:
>
>
> Should I remove HLSL from MAME
> Yes
> No

for me this lotti shader is the best looking shader and crt emulator of all time and photos speack for itself..i can suggest to not delete hlsl but integrate with this one



B2K24
MAME @ 15 kHz Sony Trinitron CRT user
Reged: 10/25/10
Posts: 2546
Send PM


Re: Taking a poll new [Re: MooglyGuy]
#332267 - 09/25/14 01:53 AM


> Since everyone seems to be going apeshit over this inaccurate "modelling" of a CRT, I
> figured I'd take a poll:


It's not a case of it being better than HLSL, it's just an alternative. In my case it was interesting to get something that was totally new to me running and seeing the results of that outcome.

A couple weeks back I didn't know how to compile SDL builds or even attempted to really use them and now that has definitely changed.

HLSL is and always will be absolutely amazing. I'll never stop using it regardless of whoever creates some shader files.



Traso
MAME Fan
Reged: 01/15/13
Posts: 2687
Send PM


The simplest answer is no.... new [Re: MooglyGuy]
#332278 - 09/25/14 05:38 AM


because there isn't an alternative in baseline.

Now, like Arnie said, if you can somehow incorporate the functionality of this shader, that would be fab. Cos I ain't messing with SDLMAME.



lamprey
MAME Fan
Reged: 12/01/11
Posts: 238
Send PM


Re: The simplest answer is no.... new [Re: Traso]
#332284 - 09/25/14 06:44 AM


> because there isn't an alternative in baseline.
>
> Now, like Arnie said, if you can somehow incorporate the functionality of this
> shader, that would be fab. Cos I ain't messing with SDLMAME.

^ This.



Traso
MAME Fan
Reged: 01/15/13
Posts: 2687
Send PM


Re: EDITED: Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME new [Re: Arnold101]
#332287 - 09/25/14 06:59 AM


> lcd samsung 40" hd ready...seems like a real crt?

I'd have to see it in person. But the lines and textures look awful nice.



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 130
Send PM


Re: The simplest answer is no.... new [Re: Traso]
#332292 - 09/25/14 08:15 AM


> because there isn't an alternative in baseline.
>
> Now, like Arnie said, if you can somehow incorporate the functionality of this
> shader, that would be fab. Cos I ain't messing with SDLMAME.

The HLSL filter already does almost everything well. Scanlines are ok. Bloom is good. NTSC effect built in is super cool. Defocus and convergence features are really nice. Arbitrary color changes through the the red_ratio/grn_ratio_blu_ratio (should be able to do tint/sat/whatever). Screen Curvature. And more probably stuff that I forget.

The shadow mask effect is the only thing that isn't great. The shadow mask uv stuff isn't right. And the x/y counts don't actually give you the right number without fudging with the shader. And if you get them right for one system then you probably messed up all the others. So you end up with a bunch of .ini files. But whatever. The rest of the shader is really great.

And Moogly is right about the shadow mask in this shader. It's not correct from a simulation standpoint. It looks good though. But's that's only because it does things the wrong way.

And if you want to, you can get the same shadow masks with the the HLSL system too btw. You just need to make a few different "effect.png" files to use with the old "mame -effect" system. They work fine over the the HLSL effects. Or over the faster CRT-geom shader (faster than Lottes. HLSL is pretty fast I think) if you're in GLSL land.

But nobody should want the HLSL system to go away. It does too much correctly. And the few people in this thread are all that run the SDL builds in Windows. Nobody really distributes those.



Mr. DoAdministrator
MAME Art Editor
Reged: 09/21/03
Posts: 4451
Loc: California
Send PM


Re: Taking a poll new [Re: MooglyGuy]
#332297 - 09/25/14 10:51 AM



> Should I remove HLSL from MAME

> Fuck No



R. Belmont
Cuckoo for Konami
Reged: 09/21/03
Posts: 9605
Loc: ECV-197 The Orville
Send PM


Re: The simplest answer is no.... new [Re: SoltanGris42]
#332310 - 09/25/14 02:38 PM


> And if you want to, you can get the same shadow masks with the the HLSL system too
> btw. You just need to make a few different "effect.png" files to use with the old
> "mame -effect" system. They work fine over the the HLSL effects. Or over the faster
> CRT-geom shader (faster than Lottes. HLSL is pretty fast I think) if you're in GLSL
> land.

Yeah, but I think the reaction proves the point that what people want, first and foremost, is plausible shadow masks and scanlines. Everything else is negotiable, and the overlay PNG version of them has been tried and found wanting pretty much since the day Aaron checked it in. It's why pre-0.106 is very popular still.



Mamesick
Troll Lamer
Reged: 09/21/03
Posts: 1649
Loc: Italy
Send PM


Re: The simplest answer is no.... new [Re: R. Belmont]
#332311 - 09/25/14 03:12 PM


> > And if you want to, you can get the same shadow masks with the the HLSL system too
> > btw. You just need to make a few different "effect.png" files to use with the old
> > "mame -effect" system. They work fine over the the HLSL effects. Or over the faster
> > CRT-geom shader (faster than Lottes. HLSL is pretty fast I think) if you're in GLSL
> > land.
>
> Yeah, but I think the reaction proves the point that what people want, first and
> foremost, is plausible shadow masks and scanlines. Everything else is negotiable, and
> the overlay PNG version of them has been tried and found wanting pretty much since
> the day Aaron checked it in. It's why pre-0.106 is very popular still.

IMHO the "hardware scanlines" in pre 0.106 shouldn't have been removed from MAME when the video core was rewritten, even if they were wrong with vertical games (they were horizontal, not rotated with the game...). Now people try to reproduce that effect with HLSL... Oh... I voted YES at the poll.



torturedutopian
MAME Fan
Reged: 02/18/08
Posts: 3
Send PM


Re: EDITED: Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME new [Re: SoltanGris42]
#332320 - 09/26/14 12:43 AM


Very nice !

I use it under Linux on a NUC i5 2.6 GHz (Intel HD 5000). With bloom enabled, it's too slow (toki is running at 90% ) and also I have to wait several seconds on a black screen when starting MAME. Strange ?

Without bloom it works perfectly.

I really love this shader, thanks again to all involved



Traso
MAME Fan
Reged: 01/15/13
Posts: 2687
Send PM


Re: The simplest answer is no.... new [Re: Mamesick]
#332351 - 09/26/14 07:27 PM


> IMHO the "hardware scanlines" in pre 0.106 shouldn't have been removed from MAME when the video core was rewritten, even if they were wrong with vertical games (they were horizontal, not rotated with the game...). Now people try to reproduce that effect with HLSL... Oh... I voted YES at the poll.


The problem with the 'hardware scanlines' feature is the (I think integer) scaling means the image is going to get re-sized dependent upon the game and your monitor's resolution. HLSL doesn't have this issue, and the occasional game where scrolling might make it look like the lines are 'above' the graphics is a far lesser evil.

Also, why pre-.106? The png effect wasn't introduced until at least .107, and the hardware scanlines feature wasn't taken out till at least a few/several cycles later.



Mamesick
Troll Lamer
Reged: 09/21/03
Posts: 1649
Loc: Italy
Send PM


Re: The simplest answer is no.... new [Re: Traso]
#332383 - 09/27/14 08:11 AM


"hardware scanlines" option which was great with DirectDraw has been removed during 0.106-0.107 cycle IIRC. That's why some shmups maniacs and/or PGM/CPS/NEOGEO fans are still at 0.105/0.106...



mjnman
MAME Fan
Reged: 04/05/17
Posts: 1
Send PM


Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME. new [Re: SoltanGris42]
#364965 - 04/06/17 01:53 PM


Hi guys,
I like much the CRT effect, it's very nice...but it's very slow on my Linux and mame 0.160 . Please, there is something can I do speed up?



R. Belmont
Cuckoo for Konami
Reged: 09/21/03
Posts: 9605
Loc: ECV-197 The Orville
Send PM


Re: Tried to get Timothy Lottes' CRT Shader working with SDLMAME. new [Re: mjnman]
#364969 - 04/06/17 07:40 PM


> Hi guys,
> I like much the CRT effect, it's very nice...but it's very slow on my Linux and mame
> 0.160 . Please, there is something can I do speed up?

The shader runs on your GPU (video card), so reducing the output resolution or getting a beefier video card are the major ways to speed it up.


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  redk9258, URherenow, Tafoid 
2 registered and 31 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 18535