This patch implements two new automasking modes based on vertex normals. Each mode has an associated angular limit and a falloff.
Brush Normal
Compares vertex normals with the initial normal at the beginning of the brush stroke.
View Normal
Compares vertex normals with the view normal. If "occlusion" is on then rays will be shot from each vertex to test if it is occluded by other geometry (note: this can be very slow). Only geometry inside the sculpt mesh is considered.