Nice challenge for you guys and girls. I've tried a lot f things, like rotation of slope, camera projection, and get normal and such, but I can't get a decent mask on one side of an object.
There is a way that I've used before, but I don't know by head. I'll try to find a clipfile.
Just to understand, something (roughly) like this?
You can use this very simple setup.
additionally, there are directional mask setups shared in file section.
https://planetside.co.uk/forums/index.php/topic,25781.0.html
Try this: https://planetside.co.uk/forums/index.php/topic,17125.msg166257.html#msg166257