Jump to content
LaunchBox Community Forums

Mame BGFX Shaders - Tutorial


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 post
Share on other sites
  • 8 months later...
  • Replies 102
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

For those that do not know what BGFX shaders are in Mame, it is a new renderer which works with HLSL. What does this mean ? Well simply put it makes everything much simpler for the end use

BGFX shaders are not very flexible to the end user since they are basically hard coded in the .json files. At the time when I did this guide HLSL was a total mess and BGFX was the superior shader

The guide is still perfectly valid, nothing is changed on how to use it. You don't have to set BGFX per game, all what I said was you cannot easily tweak the look of BGFX, you take what you get

Posted Images

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 post
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 post
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
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...