Widget Mask for Retainer Box


I want to erase the pixels of gridded icons while they are behind a translucent pop-up.

I want to create a mask for a retainer box based on the size of another widget in the view. This will allow me to “cut holes” through the interface. To do this I figure I need to fill the screen with white, and then fill the widget I want to mask out with black. After that, I want to capture the screen as an image and reference it in the effect material of the retainer box. This is all to make the mask match the UI at different window sizes.

Does anyone know of a way to capture widgets for use in a material? Big bonus if you can think of a way to do this without ever letting the user see the black and white widgets used to make the mask.

Even better if you can imagine an easier way to not render the pixels of widgets that are behind another translucent widget.


EDIT: Here’s an image of the mask I’d like to use on the widgets in the retainer box:

I’ve resolved to save screenshots of the mask at each resolution I need and choose them at runtime as appropriate.