Previous Thread
Next Thread
Print Thread
Page 3 of 6 1 2 3 4 5 6
Re: MAME 0.152->0.153 : filters not working anymore ? [Re: Ciro Consentino] #94613 06/11/14 11:10 PM
Joined: Mar 2001
Posts: 16,593
R
R. Belmont Offline
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,593
Originally Posted By Ciro Consentino

- when selecting .vsh files in the new \osd\ folder, only the CRT-geom.vsh file can be used or I can use the other too ? (CRT-geom_idx16_lut.fsh; etc...)


The parameter you give is a full path minus the file extension. MAME automatically appends ".vsh" and "_rgb32_dir.fsh". All other files are no longer necessary.

Quote:
I know the glsl_shader_mame0 gets the .vsh files from \osd\ folder.


That is an old implementation detail that has been eliminated for improved usability. glsl_shader_mame0 can now point directly to CRT or CRT-geom and everything will work fine. The shaders in src/osd/sdl/shaders are for MAME's internal processing and you should not try to load them.

Quote:
Also, what values can be used in the glsl_shader_screen0 parameters?


These are to allow different processing on each MAME screen (for e.g. OutRunners). The actual values are the same as for glsl_shader_mame0 and are interpreted the same way.

Quote:
- where the GL shader files must be placed ? in the \osd\ folder ?


The parameter can include a full path, so the shaders can be placed anywhere.

"-glsl_shader_mame0 c:\mame\shaders\CRT_geom" is entirely valid, for instance.

Last edited by R. Belmont; 06/11/14 11:13 PM.
Re: MAME 0.152->0.153 : filters not working anymore ? [Re: torturedutopian] #94614 06/11/14 11:23 PM
Joined: Apr 2006
Posts: 688
D
Dullaron Offline
Senior Member
Offline
Senior Member
D
Joined: Apr 2006
Posts: 688
Thanks for pointing out that we don't those extra files. I deleted the extras. smile


Windows 10 Home 64-bit / AMD Radeon RX 5700 XT / AMD Ryzen 7 3700X 8-Core 3.59 GHz / RAM 16 GB
Re: MAME 0.152->0.153 : filters not working anymore ? [Re: torturedutopian] #94616 06/12/14 05:32 AM
Joined: Apr 2006
Posts: 688
D
Dullaron Offline
Senior Member
Offline
Senior Member
D
Joined: Apr 2006
Posts: 688
Found more over here at. https://github.com/douglaslassance/mame

Look for the glsl folder in the mame-master.zip.

CRT-Scanlines.vsh < Good one for Space Invaders and a few others that uses artworks. Using this right now.

glsl_bilinear.vsh < Already got.
glsl_plain.vsh < Already got.

Not worth to use are these below. Nothing but color boxes. Yuck.

CRT-Phosphors.vsh
CRT-Trinitron.vsh

Edit: Found another website that have shaders that made in 2007 or the website dated wrong? Most of those from that website only have the custom yucky ones.


Windows 10 Home 64-bit / AMD Radeon RX 5700 XT / AMD Ryzen 7 3700X 8-Core 3.59 GHz / RAM 16 GB
Re: MAME 0.152->0.153 : filters not working anymore ? [Re: torturedutopian] #94621 06/12/14 01:53 PM
Joined: Mar 2001
Posts: 16,593
R
R. Belmont Offline
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,593
CRT-geom has several "knobs" in the CRT-geom.vsh file, incidentally. Open it in a text editor and look at the part between "START of parameters" and "END of parameters".

Re: MAME 0.152->0.153 : filters not working anymore ? [Re: torturedutopian] #94622 06/12/14 02:29 PM
Joined: Jun 2014
Posts: 11
C
Ciro Consentino Offline
Member
Offline
Member
C
Joined: Jun 2014
Posts: 11
Thank you for the details. I'll just add a text box with a file selection dialog for the shaders.


Ciro Alfredo Consentino
http://emuloader.mameworld.info
emuloader@gmail.com
Re: MAME 0.152->0.153 : filters not working anymore ? [Re: torturedutopian] #94629 06/12/14 07:46 PM
Joined: Apr 2006
Posts: 688
D
Dullaron Offline
Senior Member
Offline
Senior Member
D
Joined: Apr 2006
Posts: 688
Wow thanks for pointing out that the file can be edit.

I change the tilt to normal view not tilt. I did tried the tilt for the dkong and it tilt right but 1941 tilt downward instead upper. LOL


Windows 10 Home 64-bit / AMD Radeon RX 5700 XT / AMD Ryzen 7 3700X 8-Core 3.59 GHz / RAM 16 GB
Re: MAME 0.152->0.153 : filters not working anymore ? [Re: torturedutopian] #94631 06/12/14 09:18 PM
Joined: Apr 2006
Posts: 688
D
Dullaron Offline
Senior Member
Offline
Senior Member
D
Joined: Apr 2006
Posts: 688
Here is a flat screen with some rounded corners. I change the bowl screen effect to flat as well. This for Space Invaders and clones because the colors overlay or what ever those are. Call it invaders. laugh

Code:
/*  CRT Scanlines Shader
 *
 *  Copyright (C) 2012-2013 Douglas Lassance
 *  Port of the amazing CRT-Geom shader by cgwg, Themaister and DOLLS for SDLMAME and SDLMESS.
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License as published by the Free
 *  Software Foundation; either version 2 of the License, or (at your option)
 *  any later version.
 */

varying float CRTgamma;
varying float monitorgamma;
varying vec2 overscan;
varying vec2 aspect;
varying float d;
varying float R;
varying float cornersize;
varying float cornersmooth;

varying vec3 stretch;
varying vec2 sinangle;
varying vec2 cosangle;

uniform vec2 color_texture_sz;
uniform vec2 color_texture_pow2_sz;

varying vec2 texCoord;
varying vec2 one;

#define FIX(c) max(abs(c), 1e-5);

float intersect(vec2 xy)
{
  float A = dot(xy,xy)+d*d;
  float B = 2.0*(R*(dot(xy,sinangle)-d*cosangle.x*cosangle.y)-d*d);
  float C = d*d + 2.0*R*d*cosangle.x*cosangle.y;
  return (-B-sqrt(B*B-4.0*A*C))/(2.0*A);
}

vec2 bkwtrans(vec2 xy)
{
  float c = intersect(xy);
  vec2 point = vec2(c)*xy;
  point -= vec2(-R)*sinangle;
  point /= vec2(R);
  vec2 tang = sinangle/cosangle;
  vec2 poc = point/cosangle;
  float A = dot(tang,tang)+1.0;
  float B = -2.0*dot(poc,tang);
  float C = dot(poc,poc)-1.0;
  float a = (-B+sqrt(B*B-4.0*A*C))/(2.0*A);
  vec2 uv = (point-a*sinangle)/cosangle;
  float r = R*acos(a);
  return uv*r/sin(r/R);
}

vec2 fwtrans(vec2 uv)
{
  float r = FIX(sqrt(dot(uv,uv)));
  uv *= sin(r/R)/r;
  float x = 1.0-cos(r/R);
  float D = d/R + x*cosangle.x*cosangle.y+dot(uv,sinangle);
  return d*(uv*cosangle-x*sinangle)/D;
}

vec3 maxscale()
{
  vec2 c = bkwtrans(-R * sinangle / (1.0 + R/d*cosangle.x*cosangle.y));
  vec2 a = vec2(0.5,0.5)*aspect;
  vec2 lo = vec2(fwtrans(vec2(-a.x,c.y)).x,
		 fwtrans(vec2(c.x,-a.y)).y)/aspect;
  vec2 hi = vec2(fwtrans(vec2(+a.x,c.y)).x,
		 fwtrans(vec2(c.x,+a.y)).y)/aspect;
  return vec3((hi+lo)*aspect*0.5,max(hi.x-lo.x,hi.y-lo.y));
}


void main()
{

  // START of parameters

  // gamma of simulated CRT
  CRTgamma = 2.4;
  // gamma of display monitor (typically 2.2 is correct)
  monitorgamma = 2.2;
  // overscan (e.g. 1.02 for 2% overscan)
  overscan = vec2(1.00,1.00);
  // aspect ratio
  aspect = vec2(2.0, 1.75);
  // lengths are measured in units of (approximately) the width of the monitor
  // simulated distance from viewer to monitor
  d = 999.0;
  // radius of curvature
  R = 10.0;
  // tilt angle in radians
  // (behavior might be a bit wrong if both components are nonzero)
  const vec2 angle = vec2(0.0,0);
  // size of curved corners
  cornersize = 0.04;
  // border smoothness parameter
  // decrease if borders are too aliased
  cornersmooth = 1000.0;

  // END of parameters

  // Do the standard vertex processing.
  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

  // Precalculate a bunch of useful values we'll need in the fragment
  // shader.
  sinangle = sin(angle);
  cosangle = cos(angle);
  stretch = maxscale();

  // Texture coords.
  texCoord = gl_MultiTexCoord0.xy;

  // The size of one texel, in texture-coordinates.
  one = 1.0 / color_texture_pow2_sz;
}


Example from a game. https://sites.google.com/site/o0kinghanco0o/Home/ddonpach.png

Download invaders.vsh and invaders_rgb32_dir.fsh here. https://docs.google.com/viewer?a=v&p...ODY2MDBlMDU0ZmM

Last edited by Dullaron; 06/13/14 12:27 AM. Reason: Snapshot and files added.

Windows 10 Home 64-bit / AMD Radeon RX 5700 XT / AMD Ryzen 7 3700X 8-Core 3.59 GHz / RAM 16 GB
Re: MAME 0.152->0.153 : filters not working anymore ? [Re: torturedutopian] #94644 06/13/14 08:46 AM
Joined: Dec 2007
Posts: 107
T
torturedutopian Offline OP
Senior Member
OP Offline
Senior Member
T
Joined: Dec 2007
Posts: 107
Thanks for the fix, Richard !

Re: MAME 0.152->0.153 : filters not working anymore ? [Re: torturedutopian] #94645 06/13/14 09:11 AM
Joined: Dec 2007
Posts: 107
T
torturedutopian Offline OP
Senior Member
OP Offline
Senior Member
T
Joined: Dec 2007
Posts: 107
Oh by the way, I'm getting a little offtopic but partly smile As I realized MAME 0.153 introduces SH3 support which is just a little too heavy apparently for my computer (i3 NUC) I'm checking all possible performance improvements.

One thing I noticed it that, in general, even if it's a different problem, input delay is probably not as good as it could be (although acceptable compared to MAME on the raspPi smile. I stumbled upon this : https://github.com/libretro/RetroArch/wiki/KMS-mode
KMS support for libretro, which makes it possible to use the emulator without the X server and reduce delay. Would it be possible with sdlmame ?

Are there other tweaks you are aware of to reduce delay or speed in general ?

Thanks again smile

Re: MAME 0.152->0.153 : filters not working anymore ? [Re: torturedutopian] #94646 06/13/14 09:30 AM
Joined: Dec 2007
Posts: 107
T
torturedutopian Offline OP
Senior Member
OP Offline
Senior Member
T
Joined: Dec 2007
Posts: 107
(also : I heard somewhere that it was advised to use a combination of throttle=0 and syncrefresh=1 to get an optimal lag + smooth animation even if the game is sped up a little in order to be in sync with the constant LCD refresh rate ; are there any general advice on this ?)

Page 3 of 6 1 2 3 4 5 6

Moderated by  R. Belmont 

Who's Online Now
4 registered members (Monotremata, Vas Crabb, 2 invisible), 77 guests, and 2 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,102
Members4,915
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.3