How to create Mask in the Material Editor?

What’s the best way to create a mask such as the example seen in the image attached, using nothing but nodes (i.e. NO texture lookups) in the Material Editor?

49049-rectangle-masks.png

Not sure if there is a better way, but play with this:

That said, if you have a texture sample with i.e. an alpa, or Red, Green, or Blue channel left you could but the mask in there.

What’s the visual result of that network?

In the 15 minutes you needed to wait for a reply, and for me to make a screenshot… you could have already tested that.

Like I said, play around with, combine a few and you will get the result you need.

I sure could have. But there are more people who may be interested in finding a solution for this who may not be thinking it’s the best use of their time to load up the editor and re-create every single example of a node graph they come across - just to see what they do.

Thanks Luos! There were some limitations to your approach after I tried it myself, but your network inspired me to take a similar approach - which allows any rectangular shape to be masked out based on X/Y or U/V coordinates:

Glad I could help :slight_smile:
Might need it myself some day :slight_smile:

hmm I wonder if this also works with a spherical gradient.

I believe that would either give you a filled circle, or a stroked circle (depending on which output you used) - but in order to get rectangular shapes the best alternative might be a DiamondGradient that is rotated 45 degrees.

omfg is there any way to get the same result without ridiculous noodles from hell? Material editor is weird…

This thread is hella old, but I unspaghetti’d this method and added an inversion param.