- Home /
How to make a square mesh and remove a part of it in real time?
Hello.
I'm currently making a game where the field of view plays a large part in the gameplay. I've already generated a mesh for the field of view itself and it's working as intended. Objects that aren't supposed to be rendered (enemies) are not being rendered, what's supposed to be rendered is, etc.
The next thing i would like to do is make everything outside of the view cone be "in the shadows". Something along the lines of the indie game Monaco from a few years back, just with a transparent instead of solid layer. I was thinking of achieving this effect by using a square plane on top of this, with the view cone cut out of it, set to a transparent black.
My problem is I have no clue how to generate a plane object with the currently generated mesh cut out of it in real time. Most online resources haven't been of much help.
Thanks
B.