0
$\begingroup$

I made this image with a monkey head and I want to be able to make something like the second image with nodes procedurally [i made this just by duplicating a cutout] enter image description here

enter image description here

I want to be able to take a spherical gradient, or the result of the vector math length function, then use an object or a image like the first one above and make a gradient that has a value of zero at the center and 1 at the edge of the object/mask image. Making the rainbow pattern procedurally is not part of the question btw that's just easier then trying to draw the gradient.

$\endgroup$
3
  • 1
    $\begingroup$ Are you open to do that in the compositor as a post production effect ? $\endgroup$
    – Gorgious
    May 7 at 6:32
  • $\begingroup$ i recommend answering yes to Gorgious - he know what he is doing ;) $\endgroup$
    – Chris
    May 7 at 6:49
  • $\begingroup$ @Gorgious Yes, that works for what I'm doing, I could render it by itself because its just going to be a background anyway $\endgroup$ May 7 at 7:43
5
$\begingroup$

You can use the Dilate / Erode node in the Compositor Editor. Link to the docs

First setup your Object as needed and render the image.

enter image description here

Now you can play with several dilate / erode nodes to get the desired effect. It basically creates a dilated mask for each subsequent dilation and we're adding them , then dividing by the number of dilations, then plugging it into a Combine HSVA node to get rainbow colors. You can tweak it to get desired colors too.

enter image description here

There is a Distance and a Step mode in the Dilate / Erode node. I found the Distance mode to be more pleasing, but the compositing time will skyrocket on high values.

enter image description here

$\endgroup$
1
  • $\begingroup$ simply great!!!! $\endgroup$
    – Chris
    May 7 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.