Here's some reading I put together on basic CRT function to provide some context to the HLSL settings in Mame.
The image produced by a CRT is called a raster scan or just a raster for short. A raster scan is an image divided up into a sequence of horizontal strips known as scan lines. In raster scanning an electron beam sweeps horizontally left to right, then switches off (blanks) and moves rapidly back to the left, slightly lower vertically, turns back on again and sweeps out the next line of the image. A raster scan produced with a single beam can only produce a single color as in Black and White images.
A color raster scan is produced by three beams moving together, of red, green and blue assigned beams. The beams are not literally colored, they simply correspond to each of the three color channels used in CRTs.
The actual CRT image is produced by the scanning beam/s moving over tiny dots of phosphor which glow depending on the strength of the beam hitting them. The dots are arranged in groups of red, green and blue. In a color raster there are effectively three images being traced each with the right amount of color glow controlled such that when viewed together appear as a single full color image.
Phosphor dots continue to glow after the beam as moved over them. This is called phosphor persistence. By the time the whole screen has been drawn, the initial dot’s brightness will have decreased. This can appear as flicker.
To reduce flicker, CRTs produce only odd-numbered scan lines on the first vertical scan, then even-numbered lines on a second vertical scan.
Each scan is called a field. Two fields make up a single full frame or image and the process is called interlacing. A PAL Frame consists of 625 scan lines of which 576 lines are visible. In the PAL standard a CRT produces 50 fields interlaced together, to form 25 frames of video imaging a second. Let’s look at the CRT components that produce the raster scan.

A bunch of electronic components are installed inside a sealed glass tube with the air removed i.e. in a vacuum. At the very back of the tube three cathodes corresponding to the red green and blue that make up the CRT image each emit a beam of electrons. The beams are accelerated by the electron gun. The beams are focused and moved by the deflection yolk to trace out the raster scan I described.
Between the electron gun and the dot phosphor coated glass is the aperture grill otherwise known as the shadow mask. The shadow mask ensures that each beam is finely focused and strikes the phosphor dot it was intended for.

Over the years several manufactures came up with different tube designs which culminated in the superior Sony Aperture grille – slot mask. Essentially less shadow mask metal and more phosphor real estate resulting in a better picture.
To sum up:A raster scan is made up of scan lines which form the video image.
A colour raster scan is formed by three electron beams focused through a shadow mask onto targeted phosphor dots which glow at the right amount.
Now to the HLSL settings which simulate CRT behavior.
Firstly keep in mind that there is official documentation for current releases in Mame\docs\hlsl.txt. Here's my take on the settings:
hlsl_prescale Similar to the standard prescale setting in Mame, represents a multiplier applied to the original game’s resolution. For example a game with an actual resolution of 320x240 with a prescale setting of 5 applied works out at 320 x 5 = 1600 and 240 x 5 =1200 which is the native resolution of some LCD monitors. The result is a ‘sharper’ image. This needs to be set according to the monitor being used.
hlsl_snap The resolution setting for screen capture of snap images
shadow_mask_alpha Sets the visibility of the shadow mask
shadow_mask_texture Similar to the effect setting (under CORE SCREEN OPTIONS) determines which *.png file (usually in the artwork folder) is used as an overlay to simulate the shadow mask, the default aperture.png works quite well with suitable settings
shadow_mask_x y_count Sets the number of tiles of the shadow mask texture to fill the resolution with. To avoid moiré (noisy patterns on the screen) effects use the original games resolution e.g. 320 x 240
shadow_mask_uv size Sets the actual pixel usage of the shadow mask image e.g. aperture.png relative to its x & y axis when tiling.
curvature Sets the curvature of the shadow mask effect in line with the pincushion setting.
pincushion Sets the curvature of the display to simulate the curve of CRT tube face.
scanline_alpha Sets the visibility of scanlines
scanline_size The overall height of each scanline
scanline_height Individual height scaling value for scanlines
scanline_bright_scale The overall brightness multiplier for each scanline
scanline_bright_offset The overall brightness additive value for each scanline
scanline_jitter The relative scanline movement per field
defocus This defines the overall defocus radius for the three post-converged beams. Unless you want to simulate an out of focus CRT, leave this setting at default or off.
Converge xy Convergence in screen-relative xy direction. Simulates the slight convergence errors most CRTs are prone to, i.e. the scanning beam is lighting up phosphors other than the color intended.
radial_converge xy Radial convergence in screen-relative xy direction
red_ratio grn_ratio Sets the system tint
blu_ratio saturation What is says, sets the overall color saturation, set near 1 or just above for intended color setting.
Offset Offset strength of red,blue,green, more color variation control
scale Similar to brightness adjustment
power Similar effect to contrast adjustment
Floor Similar effect to gamma control
phosphor_life phosphorescence or phosphor persistence leaves trails behind moving game sprites or ghosting effects if set high.