Since
@WAS tagged me for potentially knowing a solution to this I felt a bit ambiguous.
Some may feel the experienced here sail through all aspects of creating scenes and what have you not, but for me that's surely not the case.
Yes I'm around here for a while and know a thing or two, but the thing is... I'm totally inept with math. Really.
I know zero, nada, njet, niks, nothing about math. Some say I am because I can do calculations from the top of my head pretty well, but that's 'arithmetics' to me and not math.
Anyway...just to let anyone who's reading this know: we all struggle, and it's normal. Here's my little story on how I got to this solution:
I noticed the method which is currently circulating, by BigBen, was a bit heavy on nodes and it made me start some Google searches on vector math.
From there I quickly learned that for these type of calculations you do not calculate with degrees, but with radians.
So I knew the first step needed to be a conversion of my heading value (in degrees) into radians.
Then a simple Google search for "convert radians to vector" gave me the result mentioned in bullet 3.
It showed me which mathematical steps I needed to take to go from radians to a vector.
I was not interested in the Y vector, because adding that in is basically already present in the surface layer/distribution shader, as the slope function.
So I only wanted to build the function for X and Z and the info in the link told me to use sin(X) and cos(Z).
With my vector built from the Heading input I knew I had to "compare" it with the vector from the surface.
A little bit of vague prior knowledge told me I needed either cross or dot product and the Wiki gave me the answer:
https://planetside.co.uk/wiki/index.php?title=Dot_ProductThe dot product of our manually created vector and the vector from the surface as derived from the 'Get normal 01' gives us the scalar value which we can use for the mask.
After this I noticed my mask was faint and I had trouble understanding what was going on. Despite the solution being obvious if I would have read the Wiki more closely.
Angles perpendicular are 0 and angles in the same directions approach values of 1.
Eventually Matt told me to simply multiply the function with a constant to increase the brightness/coverage of the mask.
From there on everything else was common tricks many of us already know and use...