Author Topic: Best method to expand shapes?  (Read 163 times)

Would anyone have advice on the best method to use to expand shapes in a gray mask?

For example, the input node brings in a mask that has dots (which represent holes or 'targets'), and my substance converts these dots into water stain puddles, or bullet-hole-in-paint cut-outs, etc. One of the first steps is to expand the smaller targets in that mask into something the size of the puddle/paint chipping wanted.

To do this, I've currently been using blur -> edge detect, which has a few issues when the input shapes are solid in color (you get an outline instead of a filled shape). Then I noticed the "glow" node, which also works similarly to blur, but likely has similar issues.

Are there any nodes or processes that are designed to do this? Or something someone out there has come up with that works well?

Thanks for any advice!

If your shapes are solid white, you can use a Distance into a Histogram Scan node, like this:

"Better than some, no worse than others."

If you don't mind and are able to use the work of others, I have had some pretty good success with the following Erode/Expand node by Brandon Smith on Substance Share:

I wasn't very familiar with these nodes. They do exactly what I needed. I also downloaded and checked out that corrosion expansion node. I think he's probably using these two nodes to do this! Thanks a bunch, both of you.

By the way, these seem to working well with non-solid-white shapes. Did you mean solid white as in no bevel/blur edges, or as in gray scale? If you meant gray scale, then no worries. That makes perfect sense.