MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

Luke Nukem
MAME Fan
Reged: 06/11/15
Posts: 14
Send PM


GLSL Shader compile errors.
#341375 - 06/12/15 01:40 PM


I've been banging my head on this one for a while now.

Error:
"error C0000: syntax error, unexpected $end, expecting "::" at token ""

I get this seemingly at random after a edit of a shader file. The shader would have been working perfectly fine (and works fine still in another program), yet, change a number and Bam, error in similar vein to this one.

Often the only solution is to re-write that particular section exactly the same as it was. Just... re-written... Again.

I don't know my way around Mame very well. So i can't really fix it myself (And I'm not skilled enough), but I did turn up this Stack link if someone would like to have a look;
HERE
That seems to be what I'm seeing in the Mame source, but no idea how to go about fixing it.

Cheers!

Edited by Luke Nukem (06/13/15 12:09 AM)



Website: Garage Arcades NZ
Twitter
FaceBook



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


Re: GLSL Shader compile errors. new [Re: Luke Nukem]
#341392 - 06/12/15 08:50 PM


> I've been banging my head on this one for a while now.
>
> Error:
> "error C0000: syntax error, unexpected $end, expecting "::" at token ""
>
> I get this seemingly at random after a edit of a shader file. The shader would have
> been working perfectly fine (and works fine still in another program), yet, change a
> number and Bam, error in similar vein to this one.
>
> Often the only solution is to re-write that particular section exactly the same as it
> was. Just... re-written... Again.
>
> I don't know my way around Mame very well. So i can't really fix it myself (And I'm
> not skilled enough), but I did turn up this Stack link if someone would like to have
> a look;
>
> That seems to be what I'm seeing in the Mame source, but no idea how to go about
> fixing it.
>
> Cheers!


When I was first trying to get Timothy Lottes's CRT shader working, I found there was a maximum length of shader that would be parsed. It was the file length I think. Not just the shader code. So even comments counted. Not sure about white space. If MAME is outputting the shader it doesn't like to the command window (it used to do that I think), then you might see that it was truncated before the end.

You could be just a few characters away from the limit. I was and I just wasn't realizing that the real difference between working and not working was whether the last " } " was being compiled. So I thought the error was something else.



Luke Nukem
MAME Fan
Reged: 06/11/15
Posts: 14
Send PM


Re: GLSL Shader compile errors. new [Re: SoltanGris42]
#341396 - 06/12/15 10:19 PM


That sounds logical but isn't right I don't think.



Website: Garage Arcades NZ
Twitter
FaceBook



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


Re: GLSL Shader compile errors. new [Re: Luke Nukem]
#341402 - 06/12/15 11:43 PM


> That sounds logical but isn't right I don't think.

Probably not but I thought I'd throw it out there. I just checked and it looks like anything past 8192 characters gets cut off. Comments and white space counts toward the limit too.



Luke Nukem
MAME Fan
Reged: 06/11/15
Posts: 14
Send PM


Re: GLSL Shader compile errors. new [Re: SoltanGris42]
#341403 - 06/13/15 12:06 AM


Sorry mate, I tried replying from my phone. Didn't work too well.

Try the shaders here
(Char count is 7913. No idea if this is including carriage returns or spaces it's 8176 bytes in total)

And do something like, move a line down, or expand a code block out. Eventually you get an $EOF error. It's definitely to do with Mame, as the same error causing file will work perfect in AttractMode and other programs.

Edited by Luke Nukem (06/13/15 05:44 AM)



Website: Garage Arcades NZ
Twitter
FaceBook



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


Re: GLSL Shader compile errors. new [Re: Luke Nukem]
#341410 - 06/13/15 12:46 AM


> Sorry mate, I tried replying from my phone. Didn't work too well.
>
> Try the shaders here
>
> And do something like, move a line down, or expand a code block out. Eventually you
> get an $EOF error. It's definitely to do with Mame, as the same error causing file
> will work perfect in AttractMode and other programs.

I just looked at them. You're just trying to combine the curvature and corner rounding from CRT-geom with Lotte's CRT shader? People will like that.

But I just checked. The pixel shader is 8172 characters right now. If you add 20 characters you'll hit 8192 and the last character will be cut off. Then MAME will give you the error you see.

I guess that it is a real MAME error. It should not just read the first 8K of the shader file, right? Maybe someone that knows the GLSL MAME code knows why it is like it is.

EDIT: in gl_shader_mgr.c the file sizes are hard coded to be 8192 bytes? Why?
EDIT2: I'm an idiot. Now that I actually look at that file, it's the filename string that is 8192 characters. That doesn't change the fact that only the first 8191 characters of the shader are read though. But I don't know where that is.

Edited by SoltanGris42 (06/13/15 05:55 AM)



Luke Nukem
MAME Fan
Reged: 06/11/15
Posts: 14
Send PM


Re: GLSL Shader compile errors. new [Re: SoltanGris42]
#341420 - 06/13/15 05:55 AM Attachment: example1.png 1726 KB (1 downloads)


The Halation shader is working well. Except it takes a little while (10-15 seconds) for it to load on an OpenGL capable Intel chipset. And about 1.5 seconds on an Nvidia chipset.

I've really just taken the CRT-geom shader in Mame, stripped it to just the CRT curvature code (which took a good hour of analysing) which can be applied to almost anything, it just needs be used to multiply the final pixel colour of something else.
And then bumped that into the Halation shader after stripping out the warp code.

Next I need to optimize that.


Iwish I knew enough about C++ and Mame to be able to just link in the HLSL2GLSL library. And then add all the cool menu options that are in the Windows code.

In the mean time, I'll continue tweaking the shaders while trying to keep them just under that limit. It doesn't seem likely that we would need much more than that to be honest.

[ATTACHED IMAGE - CLICK FOR FULL SIZE]

Attachment



Website: Garage Arcades NZ
Twitter
FaceBook



uman
MAME Fan
Reged: 04/15/12
Posts: 455
Send PM


Re: GLSL Shader compile errors. new [Re: Luke Nukem]
#341427 - 06/13/15 11:44 AM


> I've really just taken the CRT-geom shader in Mame, stripped it to just the CRT
> curvature code (which took a good hour of analysing) which can be applied to almost
> anything, it just needs be used to multiply the final pixel colour of something else.
> And then bumped that into the Halation shader after stripping out the warp code.
>
> Next I need to optimize that.
>
>
> Iwish I knew enough about C++ and Mame to be able to just link in the HLSL2GLSL
> library. And then add all the cool menu options that are in the Windows code.
>
> In the mean time, I'll continue tweaking the shaders while trying to keep them just
> under that limit. It doesn't seem likely that we would need much more than that to be
> honest.

Maybe I am wrong, but you could also use the shader stacks, that MAME provides.
I.e. glsl_shader_mame0 could be just the halation and then with glsl_shader_mame1 put the curvature on top of it. I like the idea of "deconstructing" shaders, with the stacks, people could easily build their own shaders to their like. Deconstructed shaders would also make it easier to create those menue sliders (like in HLSL) and they would be mixable . If you create sliders for a shader in the current state, you would need to start again from zero, if you want the same for another shader.

It is really nice, that people start to convert OpenGL shaders and i would not say that "It doesn't seem likely that we would need much more than that to be honest." because there are at least two or three more shaders, that could be very interesting and nice... NTSC-Composite and CRT-Royale coming to my mind. Also vector-shading is a thing that needs more attention, but I am on it .

I am at most a novice, when it comes to shaders, but it seems that Timothy Lottes shader can also be more optimized. This is what he wrotes me:

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

Dunno how much of that statement went into the conversion from SoltanGris42.

I hope you will sharing your results with us, it looks very promising.

Edited by uman (06/13/15 11:54 AM)



Luke Nukem
MAME Fan
Reged: 06/11/15
Posts: 14
Send PM


Re: GLSL Shader compile errors. new [Re: uman]
#341430 - 06/13/15 01:36 PM Attachment: CRT-halation.vsh.zip 4 KB (7 downloads)


> It is really nice, that people start to convert OpenGL shaders and i would not say
> that "It doesn't seem likely that we would need much more than that to be honest."
> because there are at least two or three more shaders, that could be very interesting
> and nice... NTSC-Composite and CRT-Royale coming to my mind. Also vector-shading is a
> thing that needs more attention, but I am on it .

Oh man, do you need any help with that? I'm dying to play Tempest with a decent GLSL pipeline (I refuse to run windows at all these days. Linux only, even on my MSI GS70 Laptop)

> I am at most a novice, when it comes to shaders, but it seems that Timothy Lottes
> shader can also be more optimized. This is what he wrotes me:

I'm a novice also. But also a Computer Science student (first year) at university. Miles ahead of most of the other students in what we have to study (Python is super simple to learn. But writing great code is much harder, and a challenge I enjoy immensely)

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

I'll definitely have to learn more about shaders. I can't really see how to split them like that.

> Dunno how much of that statement went into the conversion from SoltanGris42.
>
> I hope you will sharing your results with us, it looks very promising.

Sure! Check out my github. I've put the Mame version of Tim's shaders in there (AttractMode FE extras, in dir/ *name*tar.gz)

I did a bunch of comparisons between original, and what I've produced at the end via screenshots. Looks almost exactly the same, but with less calculations going on.

***Also attached current Mame GLSL version of shader. Open the .vsh to fiddle with settings.



Website: Garage Arcades NZ
Twitter
FaceBook



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


Re: GLSL Shader compile errors. new [Re: Luke Nukem]
#341440 - 06/13/15 06:29 PM


Thanks for sharing your work Luke



Ville Linde
Slacker
Reged: 05/09/04
Posts: 82
Send PM


Re: GLSL Shader compile errors. new [Re: SoltanGris42]
#341441 - 06/13/15 07:57 PM


>
> EDIT: in gl_shader_mgr.c the file sizes are hard coded to be 8192 bytes? Why?
> EDIT2: I'm an idiot. Now that I actually look at that file, it's the filename string
> that is 8192 characters. That doesn't change the fact that only the first 8191
> characters of the shader are read though. But I don't know where that is.

The real oversight is in gl_shader_tool.c: gl_compile_shader_file()

const int buffer_len=8192;

buffer = (GLcharARB *) malloc(buffer_len);



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


Re: GLSL Shader compile errors. new [Re: Luke Nukem]
#341443 - 06/13/15 08:10 PM


Luke, after extracting your attachment, I get a small box in the middle of the window on a windows system here on my end.

http://imgur.com/tzQy0Ua



silkove
MAME Fan
Reged: 02/25/06
Posts: 47
Send PM


Re: GLSL Shader compile errors. new [Re: B2K24]
#341444 - 06/13/15 08:11 PM


Hi guys, somebody explain how load this shaders in mame ?
I try with qmc2 FE, load "CRT-halation" but not luck . Tnx



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


Re: GLSL Shader compile errors. new [Re: Ville Linde]
#341445 - 06/13/15 08:34 PM


> The real oversight is in gl_shader_tool.c: gl_compile_shader_file()
>
> const int buffer_len=8192;
>
> buffer = (GLcharARB *) malloc(buffer_len);

Yeah, I've just corrected that in github top-of-tree if you guys wanna pull it and check it out.



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


Re: GLSL Shader compile errors. new [Re: Luke Nukem]
#341446 - 06/13/15 08:36 PM


I got a completely black screen here. With sound and emulation going on normally but nothing displayed. This doesn't happens to me with CRT-Geom and original Lottes shaders.

Also, you may take in consideration to release a vertical version of the shader for rotated games.



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


Re: GLSL Shader compile errors. new [Re: uman]
#341449 - 06/13/15 10:08 PM


> > I've really just taken the CRT-geom shader in Mame, stripped it to just the CRT
> > curvature code (which took a good hour of analysing) which can be applied to almost
> > anything, it just needs be used to multiply the final pixel colour of something
> else.
> > And then bumped that into the Halation shader after stripping out the warp code.
> >
> > Next I need to optimize that.
> >
> >
> > Iwish I knew enough about C++ and Mame to be able to just link in the HLSL2GLSL
> > library. And then add all the cool menu options that are in the Windows code.
> >
> > In the mean time, I'll continue tweaking the shaders while trying to keep them just
> > under that limit. It doesn't seem likely that we would need much more than that to
> be
> > honest.
>
> Maybe I am wrong, but you could also use the shader stacks, that MAME provides.
> I.e. glsl_shader_mame0 could be just the halation and then with glsl_shader_mame1 put
> the curvature on top of it. I like the idea of "deconstructing" shaders, with the
> stacks, people could easily build their own shaders to their like. Deconstructed
> shaders would also make it easier to create those menue sliders (like in HLSL) and
> they would be mixable . If you create sliders for a shader in the current state, you
> would need to start again from zero, if you want the same for another shader.
>
> It is really nice, that people start to convert OpenGL shaders and i would not say
> that "It doesn't seem likely that we would need much more than that to be honest."
> because there are at least two or three more shaders, that could be very interesting
> and nice... NTSC-Composite and CRT-Royale coming to my mind. Also vector-shading is a
> thing that needs more attention, but I am on it .
>
> I am at most a novice, when it comes to shaders, but it seems that Timothy Lottes
> shader can also be more optimized. This is what he wrotes me:
>
> "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."
>
> Dunno how much of that statement went into the conversion from SoltanGris42.
>
> I hope you will sharing your results with us, it looks very promising.

Hi uman!

Did you ever see R.Belmont's conversion of the NTSC shader MooglyGuy wrote? It was posted here:

http://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=94686#Post94686

It works pretty well from what I remember. The version on my PC has been edited so much that I'm not sure I remember how the default version worked. Note that for the most accurate effect, you'll need to set at least the color subcarrier frequency (just 3.579545 for NTSC), and then the ScanTime variable based on how many pixels the system outputs per period.

So you'd want to use something like 44.6984 (=640/3.579545/4) for ScanTime to get correct artifact colors out of a PC with composite CGA. OR 39.911112 (=560/3.579545/4) for an APPLE IIe. Don't know about consoles. Probably you'll "divide by 2" instead of "4". So the genesis (not always 320 width but...) should probably be 320/3.579545/2 and you'll get the same answer as for CGA. Or something like that.

Also, many systems will need an extra phase shift added for correct colors. The setting is called "OValue" in the HLSL version but missing from the GLSL I linked.

I'll take a look at separating some of the CRT shader out into separate passes. I started doing this before and ended up making things slower but maybe I'll have more luck this time.



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


Re: GLSL Shader compile errors. new [Re: R. Belmont]
#341451 - 06/13/15 10:32 PM


> > The real oversight is in gl_shader_tool.c: gl_compile_shader_file()
> >
> > const int buffer_len=8192;
> >
> > buffer = (GLcharARB *) malloc(buffer_len);
>
> Yeah, I've just corrected that in github top-of-tree if you guys wanna pull it and
> check it out.

I think you allocate exactly as many characters as you need to read the file now. But then overwrite the last character with a '\0' to terminate the string.

So it loses the last character from the file. Kind of important if it's a closing '}'

Thanks for the fix though!



uman
MAME Fan
Reged: 04/15/12
Posts: 455
Send PM


Re: GLSL Shader compile errors. new [Re: SoltanGris42]
#341454 - 06/14/15 12:47 AM


> Hi uman!
>
> Did you ever see R.Belmont's conversion of the NTSC shader MooglyGuy wrote? It was
> posted here:
>
> http://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=94686#Post94686
>
> It works pretty well from what I remember. The version on my PC has been edited so
> much that I'm not sure I remember how the default version worked. Note that for the
> most accurate effect, you'll need to set at least the color subcarrier frequency
> (just 3.579545 for NTSC), and then the ScanTime variable based on how many pixels the
> system outputs per period.
>
> So you'd want to use something like 44.6984 (=640/3.579545/4) for ScanTime to get
> correct artifact colors out of a PC with composite CGA. OR 39.911112
> (=560/3.579545/4) for an APPLE IIe. Don't know about consoles. Probably you'll
> "divide by 2" instead of "4". So the genesis (not always 320 width but...) should
> probably be 320/3.579545/2 and you'll get the same answer as for CGA. Or something
> like that.
>
> Also, many systems will need an extra phase shift added for correct colors. The
> setting is called "OValue" in the HLSL version but missing from the GLSL I linked.
>
> I'll take a look at separating some of the CRT shader out into separate passes. I
> started doing this before and ended up making things slower but maybe I'll have more
> luck this time.

Hi SoltanGris42,

not exactly what I meant, but what I had looked for , so i thank you for posting this link. Also nice to see, how small the shader-scene world can be. I will try Belmonts conversion with really old consoles, like Atari 2600, Coleco, NES and for the first time, I will do it with MAME . I really like that Belmonts conversion uses the glsl-pipeline. People should really see the benefit of this concept. The more deconstructed shaders are available, the more this concept will bring out good examples.

The changes we would like to do for vector stuff, will be on the vector driver/renderer level. I am not sure, but I guess this will not affect OpenGL , as i currently see no vector parameters available, other than anti-alias and flicker, if Opengl is enabled as videomode in MAME.
Even if the planned options will be available for OpenGL, vector-bloom, phosphor etc. will still be missing and it would be only half the fun .



Luke Nukem
MAME Fan
Reged: 06/11/15
Posts: 14
Send PM


Re: GLSL Shader compile errors. new [Re: SoltanGris42]
#341455 - 06/14/15 01:06 AM


> Did you ever see R.Belmont's conversion of the NTSC shader MooglyGuy wrote? It was
> posted here:
>
> http://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=94686#Post94686
>
> It works pretty well from what I remember. The version on my PC has been edited so
> much that I'm not sure I remember how the default version worked. Note that for the
> most accurate effect, you'll need to set at least the color subcarrier frequency
> (just 3.579545 for NTSC), and then the ScanTime variable based on how many pixels the
> system outputs per period.
>
> So you'd want to use something like 44.6984 (=640/3.579545/4) for ScanTime to get
> correct artifact colors out of a PC with composite CGA. OR 39.911112
> (=560/3.579545/4) for an APPLE IIe. Don't know about consoles. Probably you'll
> "divide by 2" instead of "4". So the genesis (not always 320 width but...) should
> probably be 320/3.579545/2 and you'll get the same answer as for CGA. Or something
> like that.
>
> Also, many systems will need an extra phase shift added for correct colors. The
> setting is called "OValue" in the HLSL version but missing from the GLSL I linked.
>
> I'll take a look at separating some of the CRT shader out into separate passes. I
> started doing this before and ended up making things slower but maybe I'll have more
> luck this time.

That looks damn nice!
I've got a lot of learning to do I think. Before I can use my brain to create shaders instead of modifying other peoples releases.



Website: Garage Arcades NZ
Twitter
FaceBook



Luke Nukem
MAME Fan
Reged: 06/11/15
Posts: 14
Send PM


Re: GLSL Shader compile errors. new [Re: R. Belmont]
#341468 - 06/14/15 09:13 AM


I didn't see your reply earlier. Thanks for the correction, I started doing that tonight but of course I saw it was done in the Git.



Website: Garage Arcades NZ
Twitter
FaceBook



joey35car
MAME Fan
Reged: 02/07/07
Posts: 1095
Loc: Planet Claire
Send PM


Re: GLSL Shader compile errors. new [Re: R. Belmont]
#341485 - 06/15/15 12:23 AM


> > The real oversight is in gl_shader_tool.c: gl_compile_shader_file()
> >
> > const int buffer_len=8192;
> >
> > buffer = (GLcharARB *) malloc(buffer_len);
>
> Yeah, I've just corrected that in github top-of-tree if you guys wanna pull it and
> check it out.

GLSL Timothy Lottes shader doesn't work now after compiling to the newest Git.

http://pastebin.com/CxjJaeYc



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


Re: GLSL Shader compile errors. new [Re: joey35car]
#341489 - 06/15/15 02:02 AM


> GLSL Timothy Lottes shader doesn't work now after compiling to the newest Git.
>
> http://pastebin.com/CxjJaeYc

I can confirm this.

I also checked the CRT-geom and it does the same thing. It puts the entire contents of the file into the CP window.

Edited by B2K24 (06/15/15 02:09 AM)



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


Re: GLSL Shader compile errors. new [Re: B2K24]
#341494 - 06/15/15 03:13 AM


> > GLSL Timothy Lottes shader doesn't work now after compiling to the newest Git.
> >
> > http://pastebin.com/CxjJaeYc
>
> I can confirm this.
>
> I also checked the CRT-geom and it does the same thing. It puts the entire contents
> of the file into the CP window.

It's probably this:

http://www.mameworld.info/ubbthreads/sho...part=1&vc=1

Just add an extra space to the end of the files and they should work again.



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


Re: GLSL Shader compile errors. new [Re: SoltanGris42]
#341498 - 06/15/15 04:31 AM


> Just add an extra space to the end of the files and they should work again.

Thank You! It's working again



Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4454
Loc: Melbourne, Australia
Send PM


Re: GLSL Shader compile errors. new [Re: SoltanGris42]
#341499 - 06/15/15 04:39 AM


> It's probably this:
>
> http://www.mameworld.info/ubbthreads/sho...part=1&vc=1
>
> Just add an extra space to the end of the files and they should work again.

Pushed a fix - shouldn't need the space any more.



joey35car
MAME Fan
Reged: 02/07/07
Posts: 1095
Loc: Planet Claire
Send PM


Re: GLSL Shader compile errors. new [Re: Vas Crabb]
#341500 - 06/15/15 05:13 AM


> Pushed a fix - shouldn't need the space any more.

I just did a new compile and it's working again.

Thanks



Luke Nukem
MAME Fan
Reged: 06/11/15
Posts: 14
Send PM


Re: GLSL Shader compile errors. new [Re: Vas Crabb]
#341502 - 06/15/15 05:21 AM Attachment: CRT_SHADERS.zip 8 KB (6 downloads)


Strange, I could still get a crash on compile.

This time it was a error. I've restored that particular shader from a back up, now all is fine.


BTW, Attached are the two shaders I've been messing with. The Halation shader can take a while to load, depending on your openGL implementation. It is also the slowest of them all due to the amount of single passes it does.



Website: Garage Arcades NZ
Twitter
FaceBook



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


Re: GLSL Shader compile errors. new [Re: Luke Nukem]
#341503 - 06/15/15 06:35 AM


> Strange, I could still get a crash on compile.
>
> This time it was a error. I've restored that particular shader from a back up, now
> all is fine.
>
>
> BTW, Attached are the two shaders I've been messing with. The Halation shader can
> take a while to load, depending on your openGL implementation. It is also the slowest
> of them all due to the amount of single passes it does.

CRT-lottes have a black screen.

CRT-halation crashes on loading.

Edit: Nevermind. You post message of those are broken.

Look like my ATI graphics card doesn't like those. My Nvidia graphics card have no issues. CRT-geom-20120130 and ntsc working though.



Luke Nukem
MAME Fan
Reged: 06/11/15
Posts: 14
Send PM


Re: GLSL Shader compile errors. new [Re: Dullaron]
#341505 - 06/15/15 07:20 AM Attachment: CRT-SHADERS.zip 8 KB (7 downloads)


I've updated what I could. All seems to be working well.

Halation shader now has YUV and GAMMA adjustments from the Lottes shader. (And I went over the byte limit).

Lottes shader now has the 3 types of aperture from Halation.



uman
MAME Fan
Reged: 04/15/12
Posts: 455
Send PM


Re: GLSL Shader compile errors. new [Re: Luke Nukem]
#341510 - 06/15/15 01:55 PM


It seems you missed to include some important parameters from CRT-geom and i think you didnt fully understand why they are important. You have a good tutorial (thanks to Hunter K.) of CRT-geom here: http://mame32fx.altervista.org/forum/viewtopic.php?f=1&t=184

Maybe it is just how it looks on windows or how it works on windows, but your shader is not correctly scaled on windows. It is a small picture in a big box with initial settings, like user B2K24 allready said. Please dont see it as some kind of flaming, I just want to give you feedback, how it looks on windows and I am aware that you just wanted to "improve" calculations / performance of the shader.

I also use only MAME 0161 at the moment, as I have "other" problems with 0162, but I dont think, that this is causing the problems.

Also i dont fully understand the attract mode, must be some linux thing, i mean i know what a attract mode is, just didnt know that MAME has one.

I could correct the scale, but as "D" (Distance to monitor) is missing and aspect is wrong, the "fisheye" looks wrong. I will use your 341430 version, to correct some stuff and will post a windows working version here soon. I could use your actual version, but there are more "errors" or more stuff, that I am not able to fix.

Edited by uman (06/15/15 01:57 PM)



Luke Nukem
MAME Fan
Reged: 06/11/15
Posts: 14
Send PM


Re: GLSL Shader compile errors. new [Re: uman]
#341530 - 06/15/15 10:18 PM


> It seems you missed to include some important parameters from CRT-geom and i think
> you didnt fully understand why they are important. You have a good tutorial (thanks
> to Hunter K.) of CRT-geom here:
> http://mame32fx.altervista.org/forum/viewtopic.php?f=1&t=184
>
> Maybe it is just how it looks on windows or how it works on windows, but your shader
> is not correctly scaled on windows. It is a small picture in a big box with initial
> settings, like user B2K24 allready said. Please dont see it as some kind of flaming,
> I just want to give you feedback, how it looks on windows and I am aware that you
> just wanted to "improve" calculations / performance of the shader.
>
> I also use only MAME 0161 at the moment, as I have "other" problems with 0162, but I
> dont think, that this is causing the problems.
>
> Also i dont fully understand the attract mode, must be some linux thing, i mean i
> know what a attract mode is, just didnt know that MAME has one.
>
> I could correct the scale, but as "D" (Distance to monitor) is missing and aspect is
> wrong, the "fisheye" looks wrong. I will use your 341430 version, to correct some
> stuff and will post a windows working version here soon. I could use your actual
> version, but there are more "errors" or more stuff, that I am not able to fix.


Oh I definitely don't see that as flaming. Btw, thanks for the link. I'll revert the CRT geometry bits back to the originals now, with included aspect and rotation.

You are quite correct that I don't fully understand it a of yet, this is all quite a large learning process for me. And more of something for me to do between semesters at University.

What I'm doing at the moment is trying to develop shaders for each aspect of CRT emulation, in a similar way to how the HLSL shaders are working.
Btw, I use Linux only, so not able to test on Windows.

Also, Attract Mode, is a really awesome Front End for emulators.



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


To uman new [Re: uman]
#341539 - 06/16/15 07:04 AM Attachment: blackscreen.png 11 KB (0 downloads)


I tried the CRT_Geom that you send me and I'm getting a black screen here. Doesn't do that with the CRT-geom-20120130 and Lottes_CRT_VERT_SEP_10 files. I have my screen set to HDMI cable. Maybe the small color pix boxes getting black out?

[ATTACHED IMAGE - CLICK FOR FULL SIZE]

Attachment



uman
MAME Fan
Reged: 04/15/12
Posts: 455
Send PM


Re: To uman new [Re: Dullaron]
#341542 - 06/16/15 11:08 AM Attachment: crt.jpg 684 KB (0 downloads)


That is not a good sign, seems like the latest changes did something worse . I am on windows MAME 0161 and i have zero problems. This is what i get:

[ATTACHED IMAGE - CLICK FOR FULL SIZE]

Attachment



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


Re: To uman new [Re: uman]
#341555 - 06/16/15 08:04 PM


> That is not a good sign, seems like the latest changes did something worse . I am on
> windows MAME 0161 and i have zero problems. This is what i get:

It didn't work on 0.0161 on my end. Maybe there something going on. Here is my mame.ini. This is from the newer MAME 0.162-0.163.

Like I said. No problem on the files that I have. Your files won't load or something.


Code:


#
# CORE CONFIGURATION OPTIONS
#
readconfig 1
writeconfig 0

#
# CORE SEARCH PATH OPTIONS
#
rompath arcade-roms
hashpath dev\source\hash
samplepath arcade-samples
artpath artwork
ctrlrpath ctrlr
inipath ini
fontpath .
cheatpath cheat
crosshairpath crosshair

#
# CORE OUTPUT DIRECTORY OPTIONS
#
cfg_directory output
nvram_directory output
input_directory output
state_directory output
snapshot_directory output
diff_directory output
comment_directory output

#
# CORE STATE/PLAYBACK OPTIONS
#
state
autosave 0
playback
record
mngwrite
aviwrite
wavwrite
snapname %g/%i
snapsize auto
snapview internal
snapbilinear 1
statename %g
burnin 0

#
# CORE PERFORMANCE OPTIONS
#
autoframeskip 0
frameskip 0
seconds_to_run 0
throttle 1
sleep 1
speed 1.0
refreshspeed 0

#
# CORE ROTATION OPTIONS
#
rotate 1
ror 0
rol 0
autoror 0
autorol 0
flipx 0
flipy 0

#
# CORE ARTWORK OPTIONS
#
artwork_crop 0
use_backdrops 1
use_overlays 1
use_bezels 1
use_cpanels 1
use_marquees 1

#
# CORE SCREEN OPTIONS
#
brightness 1.0
contrast 1.0
gamma 1.0
pause_brightness 0.65
effect none

#
# CORE VECTOR OPTIONS
#
antialias 1
beam 1.5
flicker 0

#
# CORE SOUND OPTIONS
#
samplerate 48000
samples 1
volume 0

#
# CORE INPUT OPTIONS
#
coin_lockout 1
ctrlr
mouse 0
joystick 1
lightgun 0
multikeyboard 0
multimouse 0
steadykey 0
ui_active 0
offscreen_reload 0
joystick_map auto
joystick_deadzone 0.3
joystick_saturation 0.85
natural 0
joystick_contradictory 0
coin_impulse 0

#
# CORE INPUT AUTOMATIC ENABLE OPTIONS
#
paddle_device keyboard
adstick_device keyboard
pedal_device keyboard
dial_device keyboard
trackball_device keyboard
lightgun_device keyboard
positional_device keyboard
mouse_device mouse

#
# CORE DEBUGGING OPTIONS
#
verbose 0
log 0
oslog 0
debug 0
update_in_pause 0
debugscript

#
# CORE COMM OPTIONS
#
comm_localhost 0.0.0.0
comm_localport 15112
comm_remotehost 127.0.0.1
comm_remoteport 15112

#
# CORE MISC OPTIONS
#
drc 1
drc_use_c 0
drc_log_uml 0
drc_log_native 0
bios
cheat 0
skip_gameinfo 0
uifont default
ramsize
confirm_quit 0
ui_mouse 0
autoboot_command
autoboot_delay 2
autoboot_script
http 0
http_port 8080
http_path dev\source\web
console 0

#
# OSD KEYBOARD MAPPING OPTIONS
#
uimodekey SCRLOCK

#
# OSD FONT OPTIONS
#
uifontprovider auto

#
# OSD DEBUGGING OPTIONS
#
debugger auto
debugger_font auto
debugger_font_size 0
watchdog 0

#
# OSD PERFORMANCE OPTIONS
#
multithreading 0
numprocessors auto
bench 0

#
# OSD VIDEO OPTIONS
#
video opengl
numscreens 1
window 0
maximize 1
keepaspect 1
unevenstretch 1
waitvsync 0
syncrefresh 0

#
# OSD PER-WINDOW VIDEO OPTIONS
#
screen auto
aspect auto
resolution auto
view auto
screen0 auto
aspect0 auto
resolution0 auto
view0 auto
screen1 auto
aspect1 auto
resolution1 auto
view1 auto
screen2 auto
aspect2 auto
resolution2 auto
view2 auto
screen3 auto
aspect3 auto
resolution3 auto
view3 auto

#
# OSD FULL SCREEN OPTIONS
#
switchres 0

#
# OSD ACCELERATED VIDEO OPTIONS
#
filter 1
prescale 1

#
# OpenGL-SPECIFIC OPTIONS
#
gl_forcepow2texture 0
gl_notexturerect 0
gl_vbo 1
gl_pbo 1
gl_glsl 1
gl_glsl_filter 1
glsl_shader_mame0 shaders\CRT-geom
glsl_shader_mame1 none
glsl_shader_mame2 none
glsl_shader_mame3 none
glsl_shader_mame4 none
glsl_shader_mame5 none
glsl_shader_mame6 none
glsl_shader_mame7 none
glsl_shader_mame8 none
glsl_shader_mame9 none
glsl_shader_screen0 none
glsl_shader_screen1 none
glsl_shader_screen2 none
glsl_shader_screen3 none
glsl_shader_screen4 none
glsl_shader_screen5 none
glsl_shader_screen6 none
glsl_shader_screen7 none
glsl_shader_screen8 none
glsl_shader_screen9 none

#
# OSD SOUND OPTIONS
#
sound auto
audio_latency 2

#
# WINDOWS PERFORMANCE OPTIONS
#
priority 0
profile 0

#
# WINDOWS VIDEO OPTIONS
#
menu 0

#
# DIRECTDRAW-SPECIFIC OPTIONS
#
hwstretch 1

#
# DIRECT3D POST-PROCESSING OPTIONS
#
hlsl_enable 0
hlslpath dev\source\hlsl
hlsl_prescale_x 0
hlsl_prescale_y 0
hlsl_preset -1
hlsl_write
hlsl_snap_width 2048
hlsl_snap_height 1536
shadow_mask_alpha 0.0
shadow_mask_texture aperture.png
shadow_mask_x_count 6
shadow_mask_y_count 6
shadow_mask_usize 0.1875
shadow_mask_vsize 0.1875
shadow_mask_uoffset 0.0
shadow_mask_voffset 0.0
curvature 0.03
round_corner 0.03
reflection 0.03
vignetting 0.03
scanline_alpha 1.0
scanline_size 1.0
scanline_height 1.0
scanline_bright_scale 1.0
scanline_bright_offset 0.0
scanline_jitter 0.0
defocus 0.0,0.0
converge_x 0.3,0.0,-0.3
converge_y 0.0,0.3,-0.3
radial_converge_x 0.0,0.0,0.0
radial_converge_y 0.0,0.0,0.0
red_ratio 1.0,0.0,0.0
grn_ratio 0.0,1.0,0.0
blu_ratio 0.0,0.0,1.0
saturation 1.4
offset 0.0,0.0,0.0
scale 0.95,0.95,0.95
power 0.8,0.8,0.8
floor 0.05,0.05,0.05
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 500.0

#
# BLOOM POST-PROCESSING OPTIONS
#
vector_bloom_scale 0.3
raster_bloom_scale 0.225
bloom_lvl0_weight 1.0
bloom_lvl1_weight 0.21
bloom_lvl2_weight 0.19
bloom_lvl3_weight 0.17
bloom_lvl4_weight 0.15
bloom_lvl5_weight 0.14
bloom_lvl6_weight 0.13
bloom_lvl7_weight 0.12
bloom_lvl8_weight 0.11
bloom_lvl9_weight 0.10
bloom_lvl10_weight 0.09

#
# FULL SCREEN OPTIONS
#
triplebuffer 0
full_screen_brightness 1.0
full_screen_contrast 1.0
full_screen_gamma 1.0

#
# INPUT DEVICE OPTIONS
#
dual_lightgun 0




uman
MAME Fan
Reged: 04/15/12
Posts: 455
Send PM


Re: To uman new [Re: Dullaron]
#341559 - 06/16/15 08:41 PM


mmmh dont know

Edited by uman (06/16/15 08:42 PM)



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


Re: To uman new [Re: uman]
#341560 - 06/16/15 08:47 PM


> mmmh dont know

Don't worry about. Might be my ATI graphics card or drivers issue. I gave up. I keep using on what I have.

I did a clean ini also.



uman
MAME Fan
Reged: 04/15/12
Posts: 455
Send PM


Re: To uman new [Re: Dullaron]
#345709 - 10/01/15 05:55 PM


We found out, what is causing the black screen. it is the tilt parameter in the .vsh file ... on some systems you maybe get a black screen, if you use:

const vec2 angle = vec2(0.0,-0.0);

try to use something slightly larger like:

const vec2 angle = vec2(0.0,-0.001);

it should fix it and depending what you are playing vertical or horizontal games, change it accordingly.



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


Re: To uman new [Re: uman]
#345722 - 10/02/15 04:22 AM


> We found out, what is causing the black screen. it is the tilt parameter in the .vsh
> file ... on some systems you maybe get a black screen, if you use:
>
> const vec2 angle = vec2(0.0,-0.0);
>
> try to use something slightly larger like:
>
> const vec2 angle = vec2(0.0,-0.001);
>
> it should fix it and depending what you are playing vertical or horizontal games,
> change it accordingly.

Didn't work at all. I did got it to work after I put a 1 at the end.

const vec2 angle = vec2(0.0,-0.0011);


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 22 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 4903