LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games
User Name
Password
Linux - Games This forum is for all discussion relating to gaming in Linux.

Notices


Reply
  Search this Thread
Old 08-02-2015, 10:56 PM   #1
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
HOWTO: Use MAME Shaders


Note: if you see people online talking about "SDLMAME", that's just MAME.

Anyway, I finally got around to trying MAME with shaders. I did this on Slackware64 14.1, using MAME 0.160. The paths I'm going to describe are correct for it, and should be correct for other distros too.

First, I created a user-level MAME directory and made a copy of the global MAME ini file:

Code:
mkdir -p ~/.mame
cp /etc/mame.ini ~/.mame
I downloaded the "shader pack" from the GLSL SHADERS SETUP (MAME/MESS) page, then unzipped it into my MAME directory:

Code:
~/.mame
tar xfv ~/Downloads/mame_glsl_osd.tar.gz
That pack comes with a CRT-geom shader. Here are the changes I then made to my mame.ini to get it activated:

Code:
waitvsync 1
glsl_shader_mame0 /home/dugan/.mame/osd/shader/glsl_plain
glsl_shader_mame1 /home/dugan/.mame/osd/CRT-geom
I know the paths work if they are absolute and have no environment variables or tildes.

You can't miss the CRT-geom shader if it's working. It makes your screen deformed as if it were the surface or a fish bowl, or like a particularly round CRT.

If you look in ~/.mame/osd, you'll see the following files:
  • CRT-geom.vsh
  • CRT-geom_idx16_lut.fsh
  • CRT-geom_rgb32_dir.fsh
  • CRT-geom_rgb32_lut.fsh

Relate that to the value of "glsl_shader_mame1" in mame.ini, and it should be pretty clear how to install and activate other shaders.

One particularly popular shader is a CRT shader called "Lottes". I downloaded it and unzipped it in ~/.mame. That put all its *.?sh files in ~/.mame/shader, so I activated it by setting the appropriate key in mame.ini:

Code:
glsl_shader_mame1 /home/dugan/.mame/shader/Lottes_CRT
SABR was one I was particular looking forward to running. It's a variation on xBR, which is an improvement on the HQnx scalers, which were in turn an improvement on SuperEagle, 2xSAI and those others ones. I already had Lottes in ~/.mame/shader, so I put all of SABR's *.?sh files in the same directory. Then I just activated it:

Code:
glsl_shader_mame1 /home/dugan/.mame/shader/sabr
So once it's set up, changing shaders is just a matter of changing one line in mame.ini.

Last edited by dugan; 08-08-2015 at 12:34 PM.
 
Old 09-22-2016, 11:04 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Original Poster
Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
The above is still correct if you want to use the (Timothy) Lottes shader, but MAME now comes with shaders built-in.

To use them:

1. copy the artwork/ and bgfx/ directories from the MAME source archive to ~/.mame

2. set the following in ~/.mame/mame.ini:

Code:
bgfx_path /absolute/path/to/.mame/bgfx
video bgfx
3. Start a game and press tilde to bring a menu. Press Down until you get to Effect and press Left and Right to change to either crt-geom-deluxe or super-eagle

4. If you chose crt-geom-deluxe (which I recommend), go back to the tilde menu and keep pressing down to set shader options such as the curvature, etc

Last edited by dugan; 09-22-2016 at 11:15 PM.
 
Old 03-25-2017, 03:44 PM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Original Poster
Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
This is what I'll be using for the foreseeable future:

1. have a ~/.mame/bgfx tree (so that I can edit the shaders)

2. have the following in ~/.mame/mame.ini:

Code:
# Smaller viewport, but evenly-sized pixels
unevenstretch             0

# This seems to still need paths with no tildes or dollar signs
bgfx_path                 /home/dugan/.mame/bgfx

bgfx_screen_chains        crt-geom-deluxe
3. Edit ~/.mame/bgfx/chains/crt-geom-deluxe.json

and change:

Code:
{
    "type": "float",
    "name": "curvature",
    "text": "Enable curvature",
    "default":  1.0,
to:

Code:
{
    "type": "float",
    "name": "curvature",
    "text": "Enable curvature",
    "default":  0.0,
to disable the curvature effect

Last edited by dugan; 03-30-2017 at 02:14 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shaders not working in Second Life with Mesa + Radeon MirceaKitsune Linux - Games 3 11-16-2013 02:16 AM
LXer: Geometry Shaders For Gallium3D LLVM LXer Syndicated Linux News 0 03-27-2013 02:11 AM
LXer: Image Processing with OpenGL and Shaders LXer Syndicated Linux News 0 11-22-2010 04:20 PM
6800LE unlocking pipelines and shaders Sapphire Linux - Software 1 12-29-2004 02:16 AM
Cel shaders for Linux opensource Linux - Software 0 01-06-2004 07:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games

All times are GMT -5. The time now is 11:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration