BGFX Effects for (nearly) Everyone¶
By default, MAME outputs an idealized version of the video as it would be on the way to the arcade cabinet's monitor, with minimal modification of the output (primarily to stretch the game image back to the aspect ratio the monitor would traditionally have, usually 4:3) -- this works well, but misses some of the nostalgia factor. Arcade monitors were never ideal, even in perfect condition, and the nature of a CRT display distorts that image in ways that change the appearance significantly.
Modern LCD monitors simply do not look the same, and even computer CRT monitors cannot match the look of an arcade monitor without help.
That's where the new BGFX renderer with HLSL comes into the picture.
HLSL simulates most of the effects that a CRT arcade monitor has on the video, making the result look a lot more authentic. However, HLSL requires some effort on the user's part: the settings you use are going to be tailored to your PC's system specs, and especially the monitor you're using. Additionally, there were hundreds of thousands of monitors out there in arcades. Each was tuned and maintained differently, meaning there is no one correct appearance to judge by either. Basic guidelines will be provided here to help you, but you may also wish to ask for opinions on popular MAME-centric forums.
Resolution and Aspect Ratio¶
Resolution is a very important subject for HLSL settings. You will want MAME to be using the native resolution of your monitor to avoid additional distortion and lag created by your monitor upscaling the display image.
While most arcade machines used a 4:3 ratio display (or 3:4 for vertically oriented monitors like Pac-Man), it's difficult to find a consumer display that is 4:3 at this point. The good news is that that extra space on the sides isn't wasted. Many arcade cabinets used bezel artwork around the main display, and should you have the necessary artwork files, MAME will display that artwork. Turn the artwork view to Cropped for best results.
Some older LCD displays used a native resolution of 1280x1024 and were a 5:4 aspect ratio. There's not enough extra space to display artwork, and you'll end up with some very slight pillarboxing, but the results will be still be good and on-par with a 4:3 monitor.
Getting Started with BGFX¶
You will need to have followed the initial MAME setup instructions elsewhere in this manual before beginning. Official MAME distributions include BGFX as of MAME 0.172, so you don't need to download any additional files.
mame.ini in your text editor of choice (e.g. Notepad), and make sure the following options are set correctly:
Now, you may want to take a moment to look below at the Configuration Settings section to see how to set up these next options.
As referenced in Order of Config Loading, MAME has a order in which it processes INI files. The BGFX settings can be edited in
mame.ini, but to take full advantage of the power of MAME's config files, you'll want to copy the BGFX settings from
mame.ini to one of the other config files and make changes there.)
In particular, you will want the
bgfx_screen_chains to be specific to each game.
Save your .INI file(s) and you're ready to begin.
`vulkan. The default is
**auto**, which will let MAME choose the best selection for you.
d3d9-- Direct3D 9.0 Renderer (Requires Windows XP or higher)
d3d11-- Direct3D 11.0 Renderer (Requires Windows Vista with D3D11 update or Windows 7 or higher)
d3d12-- Direct3D 12.0 Renderer (Requires Windows 10)
opengl-- OpenGL Renderer (Requires OpenGL drivers, may work better on some poorly designed video cards, supported on Linux/Mac OS X)
metal-- Metal Apple Graphics API (Requires OS X 10.11 El Capitan or newer)
vulkan-- Vulkan Renderer
default-- default bilinear filterered output
unfiltered-- nearest neighbor unfiltered output
hlsl-- HLSL display simulation through shaders
-numscreens) here. We use colons (:) to seperate windows, and commas (,) to seperate screens. Commas always go on the outside of the chain (see House Mannequin example)
Tweaking BGFX HLSL Settings inside MAME¶
Warning: Currently BGFX HLSL settings are not saved or loaded from any configuration files. This is expected to change in the future.
Start by loading MAME with the game of your choice (e.g. mame pacman)
The tilde key (~) brings up the on-screen display options. Use up and down to go through the various settings, while left and right will allow you to change that setting. Results will be shown in real time as you're changing these settings.
Note that settings are individually changable on a per-screen basis.