Just make a uv box mask
Its pretty simple to add.
One value for U, one for V
Then you use the value to create the box with an IF
If A > u output black, else white.
Then use the mask as the alpha of a lerp.
Or use the mask in the opacity channel or opacity mask channel depending on how the material is set up.
You can also parametrize the direction and flip one of the results at a time to obtain a way that let’s you flip the same mask around the 4 corners.
Or just rotate/pan the mask after its created.