- Home /
Creating a Masking Object with Variable Pass Through
I'm currently working on a 2D game that involves clearing and area by placing objects into a map.
There is a large overlay over the screen. When an object is placed, it clears the area around it and masks out a circle from overlay. Over time, the clearing fades back into the overlay.
I'm trying to find the simplest approach to this but I can't think of one off the top of my head. I've considered rendering everything under the overlay to a texture and then faking the mask effect by rendering portions of that texture to the clearings over top of the overlay and fading them out over time, but I'm looking for something simpler, if possible.
Thanks
Update: At the moment my current set up is to draw the making object as well as a sample of the overlay with an alpha that fades in over time that lines up with the actual overlay. It works, but I'm still wondering if anyone with more complex shader experience than myself has a more elegant solution.