Previous Thread
Next Thread
Print Thread
Page 7 of 19 1 2 5 6 7 8 9 18 19
Re: A couple GLSL issues [Re: etabeta78] #74517 11/20/11 12:56 AM
Joined: Jul 2007
Posts: 78
C
cgwg Offline OP
Member
OP Offline
Member
C
Joined: Jul 2007
Posts: 78
This was trivial to do; it's uploaded here. The old shader had the same design as the more recent one, except the scanline profile was purely gaussian, whereas the new one is not. I only had to change 3 lines in the new version of the shader.

Looking at its output, however, I think that it needs some tweaking so that the bloom effect is less harsh. Also, it looks like the maximum scanline width is too large, and the resulting scanline profile gets cut off. This can be remedied by making the scanline less wide, or adding more taps in the vertical direction.

Re: A couple GLSL issues [Re: R. Belmont] #74575 11/20/11 11:55 PM
Joined: Jul 2007
Posts: 78
C
cgwg Offline OP
Member
OP Offline
Member
C
Joined: Jul 2007
Posts: 78
I've uploaded a tweaked version of the shader with gaussian scanlines here.

Originally Posted By R. Belmont
Ok, with the curvature toned down a little and LINEAR_PROCESSING enabled (my GTX570 was insulted without the extra load ;-) I get a look I rather like.

Lacking easy access to a CRT for testing, I can't argue with what looks right, but I should point out that my choice to disable LINEAR_PROCESSING wasn't for performance reasons. As I wrote here:
Quote:
The original shader deliberately did the horizontal Lanczos interpolation in the native nonlinear color space, as that was intended to be a crude approximation of the effects of limited bandwidth in a CRT's amplifier. On the other hand, the beam should have a width greater than one pixel in addition to its height, and the beam should be blended in a linear color space. With just one pass, it's not practical to have both effects, and it would be interesting to see a comparison of screenshots.

For your convenience, I've done just that:
  • The gaussian shader, without and with LINEAR_PROCESSING.
  • The newer, nongaussian shader, without and with LINEAR_PROCESSING.

Disabling LINEAR_PROCESSING is intended to simulate the effect commonly seen in CRTs of areas with high-frequency detail being darkened.

Re: A couple GLSL issues [Re: cgwg] #76575 01/28/12 07:29 AM
Joined: Jul 2007
Posts: 78
C
cgwg Offline OP
Member
OP Offline
Member
C
Joined: Jul 2007
Posts: 78
Here's a preview of the new version that should hopefully be ready soon. I've been doing some work to improve the geometry, and this should be more accurate and allow for tilting the simulated CRT.

Re: A couple GLSL issues [Re: cgwg] #76576 01/28/12 08:31 AM
Joined: Jan 2006
Posts: 3,687
etabeta78 Offline
Very Senior Member
Offline
Very Senior Member
Joined: Jan 2006
Posts: 3,687
I look forward trying this new version smile

The previous one has become a must for my MESS setup!

Re: A couple GLSL issues [Re: cgwg] #76577 01/28/12 01:00 PM
Joined: May 1999
Posts: 576
Carbon Offline
Senior Member
Offline
Senior Member
Joined: May 1999
Posts: 576
Will those effects be available on Mac OS?

I'm asking because I remember something about HLSL effects that are Windows only.


Re: A couple GLSL issues [Re: cgwg] #76578 01/28/12 01:25 PM
Joined: Jan 2006
Posts: 3,687
etabeta78 Offline
Very Senior Member
Offline
Very Senior Member
Joined: Jan 2006
Posts: 3,687
these are GLSL filters not HLSL and they are available on both *nix and MacOSX since more than 10 releases wink

to enable them, just get the CRT filter from a couple of pages ago and launch MAME/MESS with

Code:
mame -gl_glsl -glsl_shader_mame0 ./src/osd/sdl/shader/glsl_plain -glsl_shader_mame1 ./CRT/CRT


(the first -gl_glsl enables the filters, then you need both filters for a reliable effect on all systems and games, not the CRT alone...)

Re: A couple GLSL issues [Re: cgwg] #76610 01/29/12 09:07 PM
Joined: May 1999
Posts: 576
Carbon Offline
Senior Member
Offline
Senior Member
Joined: May 1999
Posts: 576
Tried it, works great.

Will all the functionality of HLSL eventually be absorbed into GLSL?

Re: A couple GLSL issues [Re: cgwg] #76612 01/30/12 02:47 AM
Joined: Jul 2007
Posts: 78
C
cgwg Offline OP
Member
OP Offline
Member
C
Joined: Jul 2007
Posts: 78
I've uploaded the new version here. The main changes are the following:
  • More accurate geometry for simulating a spherically curved CRT. Now controlled by two parameters: radius of curvature and distance of viewer from screen.
  • Tilting of the simulated screen.
  • Hard border and rounded corners.
  • Adjustable overscan.
  • Moved most of the parameters to the vertex shader file. See the comments at the start of the main function. There are still a few #defines that can be toggled in the fragment shader files.
  • 3x oversampling of the beam profile. Reduces Moiré patterning at small output sizes. This has probably the biggest impact on performance, and should be disabled if things become sluggish.

Re: A couple GLSL issues [Re: cgwg] #76613 01/30/12 01:03 PM
Joined: Jan 2012
Posts: 22
Q
quartz Offline
Member
Offline
Member
Q
Joined: Jan 2012
Posts: 22
howdy from someone who only found this thread a few minutes ago. I just got back into mame and have been trying to find good glsl filters. your CRT filter does a pretty good job of making these games look authentic.

I just wanted to pop my head in and say that the new CRT-geom you just posted doesn't work for me, FWIW. I get this:
Quote:
src/osd/sdl/gl_shader_tool.c:370: GL Error: object 0x15 compilation failed
src/osd/sdl/gl_shader_tool.c:370 glInfoLog: ERROR: 0:36: '*' : wrong operand types no operation '*' exists that takes a left-hand operand of type 'const int' and a right operand of type 'varying float' (or there is no acceptable conversion)
ERROR: 0:36: '*' : wrong operand types no operation '*'
followed by a dump of the vsh.

looks like line 36 in the .vsh has an issue. if I edit it into a dummy value like "float C = 0.5", it can get past that, but then dies again with the same "wrong operand" problem on a later line. I'll readily admit though that I don't know glsl from a hole in the wall so this may be a red herring.

I'm on osx 10.6.8 with an nvidia 8600mgt, and the sdlmame 144 stable from sdlmame.parodius.com (his 144u6 link is broken and I don't want to deal with compiling from source).

Re: A couple GLSL issues [Re: quartz] #76628 01/31/12 01:28 AM
Joined: Jul 2007
Posts: 78
C
cgwg Offline OP
Member
OP Offline
Member
C
Joined: Jul 2007
Posts: 78
Sorry, that type of issue seems to always turn up. Nvidia's GLSL compiler tends to be more permissive than others. I managed to figure out how to enable GLSL debug output in MAME, and this version, which compiles without any warnings, should hopefully work for you (I changed 2 to 2.0 in two places).

Page 7 of 19 1 2 5 6 7 8 9 18 19

Moderated by  R. Belmont 

Who's Online Now
3 registered members (Vas Crabb, Fake Shemp, 1 invisible), 68 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,818
Posts116,101
Members4,915
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.3