D3D Post-Processing Options


HLSL Introduction
OK these options are very complex and require a bit of knowledge on how a Cathode Ray Tube (CRT) TV works. In the simplest terms, a beam of photons is fired at a phosphorescent screen behind a mesh of red,green and blue colours. Say that the signal wanted a red colour, the beam would miss the green and blue colours and only hit the red one. Using a combination of colours and power, the beam can create almost any colour.

The beam travels across the screen hitting the colours it needs. This is called a scanline. To generate a whole screen the beam first travels down every other scanline and then as it switches off those lines it draws the lines in between. This is called interlacing and can happen at different hertz (normally 50hz or 60hz). Interlaced screens were the norm for many years until progressive screens came in. These ran at twice the speed but drew each line in one pass. This gave a more detailed picture and most modern tv's are now progressive scan.

What HLSL does is simulate how a CRT TV looks when displaying a game or system through the use of 3D shaders. This is a very efficient way of adding effects as it uses little CPU time as the hard work is done by your graphics card.

hlslpath
Description This option lets you specify the path of the required HLSL files. You can add multiple paths by separating them with a semicolon (;)
Full Command -hlslpath <path>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlslpath hlsl
Mame.ini Command hlslpath
Command Default hlsl
Argument Format <path>;<path>;...

hlsl_enable
Description This option enables the HLSL renderer in Mame.
Full Command -hlsl_enable
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable
Mame.ini Command hlsl_enable
Command Default 0
Argument Format none

hlsl_oversampling
Description This option enables oversampling in the HLSL system.
Full Command -hlsl_oversampling
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -hlsl_oversampling
Mame.ini Command hlsl_oversampling
Command Default 0
Argument Format none

hlsl_write
Description This option will record Mame's output as an uncompressed AVI file. This will use up a huge amount of hard disk space and disk bandwidth. This option requires a filename or can be set to auto where Mame will create the filename based, on the system, for you.
Full Command -hlsl_write <filename>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -hlsl_write output.avi
Mame.ini Command hlsl_write
Command Default auto
Argument Format <filename>

hlsl_snap_width
Description This option lets you set the width of the snapshot image that can be taken with the F12 key.
Full Command -hlsl_snap_width <integer>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -hlsl_snap_width 1024
Mame.ini Command hlsl_snap_width
Command Default 2048
Argument Format <integer>

hlsl_snap_height
Description This option lets you set the height of the snapshot image that can be taken with the Alt+F12 key.
Full Command -hlsl_snap_height <integer>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -hlsl_snap_height 768
Mame.ini Command hlsl_snap_height
Command Default 768
Argument Format <integer>

shadow_mask_tile_mode
Description This option sets when the HLSL system applies the shadow mask. 1 will apply the shadow mask before on the source image is scaled and 0 will apply it to the output screen after scaling.
Full Command -shadow_mask_tile_mode <integer>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -shadow_mask_tile_mode 1
Mame.ini Command shadow_mask_tile_mode
Command Default 0
Argument Format <integer>

shadow_mask_alpha
Description This option sets the level of alpha blending applied to the shadow mask image. The highest level is 1.0 (fully blended) and the lowest is 0.0 (no blending).
Full Command -shadow_mask_alpha <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -shadow_mask_alpha 0.3
Mame.ini Command shadow_mask_alpha
Command Default 0.0
Argument Format <float>

shadow_mask_texture
Description This option sets the name of the png based image file to be used as the shadow mask image for the HLSL renderer.
Full Command -shadow_mask_texture <filename>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -shadow_mask_texture
Mame.ini Command shadow_mask_texture
Command Default shadow-mask.png
Argument Format <filename>

shadow_mask_x_count
Description This option sets the output width in pixels of the shadow mask image defined by shadow_mask_usize and shadow_mask_vsize.
Full Command -shadow_mask_x_count <integer>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -shadow_mask_image shadow-mask.png -shadow_mask_usize 0.5 -shadow_mask_x_count 16
Mame.ini Command shadow_mask_x_count
Command Default 6
Argument Format <integer>

shadow_mask_y_count
Description This option sets the output height in pixels of the shadow mask image defined by shadow_mask_usize and shadow_mask_vsize.
Full Command -shadow_mask_y_count <integer>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -shadow_mask_image shadow-mask.png -shadow_mask_vsize 0.5 -shadow_mask_y_count 16
Mame.ini Command shadow_mask_y_count
Command Default 4
Argument Format <integer>

shadow_mask_usize
Description This option sets the horizontal offset for the shadow mask created from the original shadow mask image, measured as a percentage from the top left corner.
Full Command -shadow_mask_usize <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -shadow_mask_image shadow-mask.png -shadow_mask_uoffset 0.5
Mame.ini Command shadow_mask_usize
Command Default 0.1875
Argument Format <float>

shadow_mask_vsize
Description This option sets the vertical offset for the shadow mask created from the original shadow mask image, measured as a percentage from the top left corner.
Full Command -shadow_mask_vsize <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -shadow_mask_image shadow-mask.png -shadow_mask_voffset 0.5
Mame.ini Command shadow_mask_usize
Command Default 0.1875
Argument Format <float>

shadow_mask_uoffset
Description This option sets the horizontal offset of the image created from the shadow mask image, set as a percentage from the top left corner. Value can be between 1.0 and -1.0 .
Full Command -shadow_mask_uoffset <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -shadow_mask_image shadow-mask.png -shadow_mask_uoffset 0.5
Mame.ini Command shadow_mask_uoffset
Command Default 0.0
Argument Format <float>

shadow_mask_voffset
Description This option sets the vertical offset of the image created from the shadow mask image, set as a percentage from the top left corner. Value can be between 1.0 and -1.0 .
Full Command -shadow_mask_voffset <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -shadow_mask_image shadow-mask.png -shadow_mask_voffset 0.5
Mame.ini Command shadow_mask_voffset
Command Default 0.0
Argument Format <float>

distortion
Description This option sets the strength of quadratic screen distortion used by the HLSL renderer. This is entered as a percentage of 1.0 with the minimum of 0.0.
Full Command -distortion <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -distortion 0.2
Mame.ini Command distortion
Command Default 0.0
Argument Format <float>

cubic_distortion
Description This option sets the strength of cubic screen distortion used by the HLSL renderer. This is entered as a percentage of 1.0 with the minimum of 0.0.
Full Command -cubic_distortion <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -cubic_distortion 0.2
Mame.ini Command cubic_distortion
Command Default 0.0
Argument Format <float>

distort_corner
Description This option sets the strength of distortion on only the screen corners drawn by the HLSL renderer. This is entered as a percentage of 1.0 with the minimum of 0.0.
Full Command -distort_corner <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_ebable -distort_corner 0.2
Mame.ini Command distort_corner
Command Default 0
Argument Format <float>

round_corner
Description This option sets the amount that the screen corners are rounded by the HLSL renderer. This is done as a float value starting at 0.0 .
Full Command -round_corner <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -round_corner 0.2
Mame.ini Command round_corner
Command Default 0.0
Argument Format <float>

smooth_border
Description This option sets the amount screen edge smoothing done by the HLSL renderer. This is done as a float value starting at 0.0 .
Full Command -smooth_border <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -smooth_border 0.05
Mame.ini Command smooth_border
Command Default 0.0
Argument Format <float>

reflection
Description This option sets the level of reflection of a simulated light on the screen. This is done as a float value starting at 0.0 .
Full Command -reflection <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -reflection 0.2
Mame.ini Command reflection
Command Default 0.0
Argument Format <float>

vignetting
Description This option simulates the darkness at the edges of CRT screens giving a pseudo 3D effect. This is done as a float value starting at 0.0 .
Full Command -vignetting <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -vignetting 0.3
Mame.ini Command vignetting
Command Default 0.0
Argument Format <float>

scanline_alpha
Description This option sets the amount of alpha blending applied to the scanline effect drawn by the HLSL renderer. 1.0 is completely black and 0.0completely transparent.
Full Command -scanline_alpha <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -scanline_alpha 0.5
Mame.ini Command scanline_alpha
Command Default 0.0
Argument Format <float>

scanline_size
Description This option sets the spacing of the scanlines drawn by the HLSL renderer. 1.0 sets the standard alternate spacing and changing it will increase/decrease the amount of scanlines drawn
Full Command -scanline_size <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -scanline_size 0.5
Mame.ini Command scanline_size
Command Default 1.0
Argument Format <float>

scanline_variation
Description This option changes the width of the drawn scanlines based on their brightness. 0.0 has no effect and the highest value is 2.0 .
Full Command -scanline_variation <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -scanline_variation 1.5
Mame.ini Command scanline_variation
Command Default 1.0
Argument Format <float>

scanline_bright_scale
Description This option sets the brightness of the drawn scanlines. 1.0 is the default level. Any value over 1.0 will brighten the scanline and below will darken.
Full Command -scanline_bright_scale <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -scanline_bright_scale 5
Mame.ini Command scanline_bright_scale
Command Default 1.0
Argument Format <float>

scanline_jitter
Description This option sets the amount of jitter (wobble) of the scanlines. Values can range between 0.0 and 1.0.
Full Command -scanline_jitter <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -scanline_jitter 0.25
Mame.ini Command scanline_jitter
Command Default 0.0
Argument Format <float>

hum_bar_alpha
Description This option sets the strength of the hum bar effect drawn by the HLSL renderer.
Full Command -hum_bar_alpha <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -hum_bar_alpha 0.05
Mame.ini Command hum_bar_alpha
Command Default 0.0
Argument Format <float>

defocus
Description This option blurs each pixel on the screen, simulating a poorly maintained monitor. The numbers entered are for X and Y values separated by a comma (,)
Full Command -defocus <float>,<float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -defocus 1.5,1.5
Mame.ini Command defocus
Command Default 0.0,0.0
Argument Format <float>,<float>

converge_x
Description This option horizontally offsets the red, green and blue colours by the value that you set. This simulates a poorly maintained monitor.
Full Command -converge_x <float>,<float>,<float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -converge_x 0.0,-1.5,0.0
Mame.ini Command converge_x
Command Default 0.0,0.0,0.0
Argument Format <float>,<float>,<float>

converge_y
Description This option verticaly offsets the red, green and blue colours by the value that you set. This simulates a poorly maintained monitor.
Full Command -converge_y <float>,<float>,<float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -converge_y 0.0,-1.5,0.0
Mame.ini Command converge_y
Command Default 0.0,0.0,0.0
Argument Format <float>,<float>,<float>

radial_converge_x
Description This option horizontally offsets the red, green and blue colours by the value that you set. This simulates a poorly maintained monitor.
Full Command -radial_converge_x <float>,<float>,<float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -radial_converge_x 0.0,-1.5,0.0
Mame.ini Command radial_converge_x
Command Default 0.0,0.0,0.0
Argument Format <float>,<float>,<float>

radial_converge_y
Description This option verticaly offsets the red, green and blue colours by the value that you set. This simulates a poorly maintained monitor.
Full Command -radial_converge_y <float>,<float>,<float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -radial_converge_y 0.0,-1.5,0.0
Mame.ini Command radial_converge_y
Command Default 0.0,0.0,0.0
Argument Format <float>,<float>,<float>

red_ratio
Description This option biases the red, green and blue colour channels by the values that you set. These are converted into a 3x3 matrix and applied to the red channel.
Full Command -red_ratio <float>,<float>,<float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -red_ratio 1.0,0.5,0.0
Mame.ini Command red_ratio
Command Default 0.0,0.0,0.0
Argument Format <float>,<float>,<float>

grn_ratio
Description This option biases the red, green and blue colour channels by the values that you set. These are converted into a 3x3 matrix and applied to the green channel.
Full Command -grn_ratio <float>,<float>,<float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -grn_ratio 0.5,1.0,0.0
Mame.ini Command grn_ratio
Command Default 0.0,0.0,0.0
Argument Format <float>,<float>,<float>

blu_ratio
Description This option biases the red, green and blue colour channels by the values that you set. These are converted into a 3x3 matrix and applied to the blue channel.
Full Command -blu_ratio <float>,<float>,<float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -blu_ratio 0.0,0.5,1.0
Mame.ini Command blu_ratio
Command Default 0.0,0.0,0.0
Argument Format <float>,<float>,<float>

saturation
Description This option sets you set the colour saturation of the screen drawn by the HLSL renderer. 1.0 is the default value and higher values will over-saturate the colours and lower values will do the opposite.
Full Command -saturation <float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -saturation 0.9
Mame.ini Command saturation
Command Default 1.0
Argument Format <float>

offset
Description This option strengthen or weakens the current color value of a given channel. For instance, a red signal of 0.5 with an offset of 0.2 will be raised to 0.7.
Full Command -offset <float>,<float>,<float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -offset 0.0,0.01,-0.02
Mame.ini Command offset
Command Default 0.0,0.0,0.0
Argument Format <float>,<float>,<float>

scale
Description This option applies scaling to the current color value of the channel. For instance, a red signal of 0.5 with a scale of 1.1 will result in a red signal of 0.55.
Full Command -scale <float>,<float>,<float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -scale 0.0,0.01,-0.02
Mame.ini Command scale
Command Default 0.0,0.0,0.0
Argument Format <float>,<float>,<float>

power
Description This option exponentiates the current colour value of the channel, also called gamma. For instance, a red signal of 0.5 with red power of 2 will result in a red signal of 0.25. This setting also can be used to adjust line thickness in vector games..
Full Command -power <float>,<float>,<float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -power 0.0,0.01,-0.02
Mame.ini Command power
Command Default 0.0,0.0,0.0
Argument Format <float>,<float>,<float>

floor
Description This option sets the absolute minimum colour value of a channel. For instance, a red signal of 0.0 (total absence of red) with a red floor of 0.2 will result in a red signal of 0.2. Typically used in conjunction with artwork turned on to make the screen have a dim raster glow.
Full Command -floor <float>,<float>,<float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -floor 0.0,0.01,-0.02
Mame.ini Command floor
Command Default 0.0,0.0,0.0
Argument Format <float>,<float>,<float>

phosphor_life
Description This option sets how long the colour channel stays on the screen, also called phosphor ghosting. 0 gives absolutely no ghost effect, and 1 will leave a contrail behind that is only overwritten by a higher color value. This also affects vector games quite a bit..
Full Command -phosphor_life <float>,<float>,<float>
Alt. Command none
Reverse Command none
Example mame64 pacman -hlsl_enable -phosphor_life 0.0,0.01,-0.02
Mame.ini Command phosphor_life
Command Default 0.0,0.0,0.0
Argument Format <float>,<float>,<float>