Invert the Map Value Node

hi!

does anyone know if it’s possible to reverse the map value node? i’m trying to use it as a blend factor for a filter, and i want the filter to blend in closer to the camera, and fade out the further away it gets. normally, i use the map value node to make a background haze by taking the Z value from a render layer, plugging it into the Map Value, adjusting the settings, then using that with a color mix node to blend in the haze. i want to reverse the output of the map value so that the “haze” is up front, and the black is in the back. is this possible?

here’s a screenshot to illustrate. instead of black up front, i want the haze up front. i’ve tried using a color invert node, but that didn’t work. :frowning:


If you want to invert something, why don’t you just invert this?
You don’t “invert the map value”, but invert the result of map value node. You invert this exactly the same as anything else:
Simply pass it through “invert” node. As simple as that. “Invert” node is in “color” category.

@ BartekSkorupa - thank you for the reply! unfortunately, as i stated originally, that does not work. the color invert node does not give you an exact inversion. this is what you get when you do as you’ve suggested:


i think i’ve found a solution though, which is to move some of the map value nodes into the negative (doh!), like so:


In Map Value node you can as well activate “Use Minimum” and leave it at 0.0. This way you won’t get negative values in output of this node, so after inverting you won’t get those superbright values.
When you see black color on the picture - it’s good to check if this color is really black or have negative values.
If you are using image editor to view your result simply left click the image and at the bottom you’ll see the values of the color.
If you’re using backdrop - alt-left click.