Compose two images with mask?

I’m trying to compose two images, using depth mask. I created one, so I just need to plase one image over the second one, using this mask. But I can’t figure out, which node can do it. Alpha Over and Mix are not the case, because they mixing images somehow even in fully black areas.


If your mask is the z map value, use a color ramp and/or normalize value before using a mix rgb node (the z map should mix properly after the normalization)

Sparazza

“map value” isn’t enough? Viewer node shows nice mask after it.

The map value is OK but you need to normalize or clamp it after the “map value” pass
This happens because the infinite z values are still infinite after the map value pass, into this pass use the “maximum value” check if you want to use it like a mix factor

Also if you want a better z pass (with antialias and correct alpha) you could enable the mist pass in the renderlayer panel and use it instead of the z-depth… Remember to configure the mist depth in the world settings (don’t need to enable it, just configure)

Cheers
Sparazza

That ramp thing worked, thanks!