Jump to content
LaunchBox Community Forums

Mame BGFX Shaders - Tutorial


Lordmonkus

Recommended Posts

I want to choose Shadow mask: "none" with crt-geom-deluxe,

so how do I edit the crt-geom-deluxe.json ?

"input": [
                { "sampler": "mpass_texture", "target": "internal1" },
                { "sampler": "mask_texture", "texture": "bgfx/chains/crt-geom/aperture_1_2_bgr.png", "selection": "Shadow mask" },
                { "sampler": "blur_texture", "target": "blur" }
            ],

 

Solved... "none.png".

Edited by virtuoso
Link to comment
Share on other sites

  • 8 months later...

Hi guys,

I have a strange issue.

While Arcade 64 displays the shader OK (CRT GEOM HQ), running the games using the regular mame.exe (229) does not!

Everything is in the same folder

I have a vertical.ini and horizont.ini

Both Arcade64 and mame.exe TATE the vertical games OK (so mame.exe does indeed process the both ini files).

The problem is the shader

Here is my vertical.ini in case someone spots something

Thank you

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

#
# CORE SCREEN OPTIONS
#
brightness                0.95
contrast                  1.1
gamma                     0.7
effect                    none

#
# OpenGL-SPECIFIC OPTIONS
#
glslpath                  glsl
gl_forcepow2texture       0
gl_notexturerect          0
gl_vbo                    1
gl_pbo                    1
gl_glsl                   1
gl_glsl_filter            1
gl_glsl_sync              0
glsl_shader_mame0         "CRT Geom HQ Vertical"
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

#
# DIRECT3D POST-PROCESSING OPTIONS
#
hlsl_enable               0
hlslpath                  hlsl
hlsl_prescale_x           4.5
hlsl_prescale_y           3.75
hlsl_preset               -1
hlsl_write
hlsl_snap_width           1440
hlsl_snap_height          900
shadow_mask_alpha         0.150000
shadow_mask_texture       crt_shadow_mask.png
shadow_mask_x_count       320
shadow_mask_y_count       240
shadow_mask_usize         0.375
shadow_mask_vsize         0.25
curvature                 0.15
pincushion                0.0
scanline_alpha            0.5
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.3,0.0,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.0
offset                    0.0,0.0,0.0
scale                     1.0,1.0,1.0
power                     1.0,1.0,1.0
floor                     0.01,0.01,0.01
phosphor_life             0.0,0.0,0.0

#
# BLOOM POST-PROCESSING OPTIONS
#
vector_bloom_scale        0.3
raster_bloom_scale        0.17
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

 

Edited by Wally
Link to comment
Share on other sites

  • 4 months later...

Hi everyone.  So I have been trying to replicate the MAME core (retroarch) shader for CRT Geom.  It looks fantastic in retroarch but the stand alone MAME is much better.  I've been messing with BGFX and their version of CRT Geom doesn't look the same.  The scanlines seem to be running vertically rather than horizontally and the screen is very, very dark.  I have try Derek Moore's (Youtube tutorial on HLSL) settings but his version of MAME is .174 and I'm on .226 and they ini file doesn't seem to have much of an effect.  Does anyone have a setup on a more recent version of mame with good scanlines working?

Link to comment
Share on other sites

  • 6 months later...
  • 9 months later...
1 hour ago, davidgrohl said:

I would like to increase the curvature a little bit. How can I do this?

Assuming you're using stand-alone MAME... Start MAME and check that you have HLSL turned on.  You need this ON to see the slider for quadric distortion (see below).   Go to Configure OptionsVideo Options, and set HLSL = On. Press Escape a couple time to get back to the main screen.

Start a game, like Bubble Bobble (bublbobl).  Once loaded, press Tab and select Slider Controls.  Arrow down to Quadric Distortion Amount.  Use left and right arrows to change it to how you like it.  Write that number down because it won't [permanently] save anywhere.  Exit the game and MAME.

Next you need to save that number to an INI configuration file in MAMEs "ini" subfolder.  Because of how MAMEs order of precedence works when loading configuration files, you want to put that number in the last INI file that loads.  Which is the game specific INI file (#9 and 10 on the list) that you would need to create.  In this case, "bublbobl.ini".  You'd need to create that for every game you want the curvature.

As an option, (a little less work) you can edit the Monitor type INI files (#6 on the list).  vector.ini for vector monitors, raster.ini for CRT raster monitors.  The 2 more common.  These are located under ..MAME/ini/presets/.  

The value you want to change in those is distortion.  Change "0.0" to the number you came up with earlier.  Save and close the file(s).  Play games.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...