Can I use the area of my procedural mesh instead of the area of SphereMask for this post process material?

This is the material screenshot

The procedural mesh component segment that I want to use instead of the SphereMask is a 2D polygon that represents the area visible to the player character, created at runtime and the mesh segment is updated every tick.

I got this image from this video:

It shows something similar to what I want to achieve, which is the “Line of sight” feature or “Fog of war” feature that you can see in games like League Of Legends or Dota2 (my game also intends to be a top-down MOBA).

I think that if it’s needed to have a 3D procedural mesh polygon instead of a 2D procedural mesh polygon (to use that area instead of the SphereMask) for this I can probably handle making it a 3D polygon myself.

However, currently I have no idea on how to make my mesh’s area visibile to the player character and the method in this video seems pretty good, just need a way/hint/suggestion to replace the SphereMask with my mesh’s area.
Answers for blueprint or for c++ are both welcome.

If you know an alternative method to achieve this kind of line of sight, I’d gladly read about it.

I’m new to UE, sorry if this post is missing any details, if so please let me know what I missed.
Thanks!

any answer?