3
$\begingroup$

I'm trying to use the Shader Editor to put four transparent images onto one object.

My approach to this was to add all of the alpha channels together and then to use that combined alpha to mask the image textures.

enter image description here

However when I do this, depending on different combinations of setting for the MixRGB node, the textures come black our just have the fuzzy edges.

I've also tried setting the textures to premultiplied but no luck.

$\endgroup$
3
$\begingroup$

It is easier if you don't think in terms of transparency and think of masks. (read: Change Color Associated with Transparency? and Add a transparent image on top of a material)

When working with shaders, RGB information and Masks (based on alpha channels) follow separate paths.

So let's break this in two parts.

  • RGB

    Combine the RGB information using the alpha channel of each one of the image being overlaid as a mask (fac), to control the mix over the background image. Note that you don't use the alpha of the very first image in the chain, you overlay the 2nd image using it's alpha channel to control the mix over the 1st one.

enter image description here

  • Alpha

    Then you can use the sum of all of the alpha channels as a mask to control the mix of color or shaders. You can use a Convert>Math node and set it to add mode.

    To mix the colors and use them as a shader color:

enter image description here

To control the mix of other shaders:

enter image description here

$\endgroup$

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.