Author Topic: creating a wide gradient mask from curvature map  (Read 1160 times)

I've been trying to take a curvature map baked in designer and create a mask from it that expands the white values on the convex areas to be much wider, tapering to black in a smooth gradient the further they are from the edge, ideally the width would be tied to how strong the curvature is (more white = wider gradient) however, what I thought would be easy to accomplish is still stumping me after several hours.

I've gotten decent result using the edge generators and mask builder for expanding the curvature's area of influence, the tricky bit is smoothing that harsh white into a smooth gradient without creating uv seams - blurring the output causes these


blurring the output of an edge wear or mask builder helps create the gradient I want, but creates seams (even with fairly decent padding) maybe some sort of masking could fix this?


manually painted illustration of desired effect in blender, would like to automate this in SD from curvature map


If anyone knows how I might solve this, I'd greatly appreciate the help! Thanks,

-Nolan Grant
Last Edit: July 26, 2018, 11:58:25 pm

Try the following:

Separate out the green channel from your position bake (using an RGBA split node).  I’ll call this G.

Feed the curvature into a ‘slope blur’ node, using G as the ‘slope’.

Create another ‘slope blur’ node, and feed in the curvature again, but this time use the inverse of G as the slope (feed it into a ‘invert greyscale’ node first).

Combine the two outputs.

————————-

You might then try overlaying the result on top of itself (maybe in combination with a levels node) to strengthen the areas of stronger curvature, and reduce the weaker ones.

AJ