0
$\begingroup$

I have a gradient texture in a colorramp to control a mask for shading, but it is masking the opposite part of what I want. This is what I have:

And I want to have this, but opposite, where the white is where the black is and the black is where the white is. So of course I used an invert node because that's what it does right? apparently not exactly, because this is what I got when I plugged it in:

enter image description here

So yeah, how do I invert it properly?

$\endgroup$
5
  • 1
    $\begingroup$ You can just swap the two sliders on the ColorRamp and lack the Invert node with the same result. Probably what we see on the pictures is a kind of illusion, the nodes are works right. May be you have to adjust the ColorRamp to enlarge the black region. $\endgroup$
    – FFeller
    Commented May 11, 2022 at 17:18
  • $\begingroup$ Your original white strip is a range of values from (just over) 0 to 1, the invert node will take value .8 and make it .2, for example. $\endgroup$ Commented May 11, 2022 at 18:19
  • $\begingroup$ A color ramp with two white stops on either end, and one or two black stops in the middle might give you what you want $\endgroup$ Commented May 11, 2022 at 18:19
  • $\begingroup$ Just because the textures look different, when they've been through whatever view transform they've been put through, for your display device (sRGB?), and then, your display device, doesn't mean they are different, from the POV of masking. If you put both gradients through the same threshold ( Math > Less Than say, 0.5 ,) The edges should match. $\endgroup$
    – Robin Betts
    Commented May 11, 2022 at 19:09
  • $\begingroup$ why don't you just use a math operation after the colorramp (1 - x) where x is the result of the colorramp? $\endgroup$
    – Chris
    Commented May 12, 2022 at 7:07

1 Answer 1

1
$\begingroup$

You could do this with Invert if you had a pure black and white mask (values of 0 and 1, and nothing in between).

You can turn your current mask into this with a Math -> Divide node like so. Be sure to check the Clamp option.

enter image description here

The Invert will simply swap the colors.

However, since you've built a gradient, and I assume you want all of those values in between, the easiest way is probably to duplicate your ColorRamp and modify the stops.

enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .