# Stacking two textures with alpha on top of each other [2.81, Eevee]

So I've been trying to stack two textures with alpha on top of each other and while I can remove the Alpha on each with enabling alpha blend the problem is the textures bleed into them.

From what I gather it has to do with the FAC value the alpha is plugged in or set manually, which might be expected from a mix note...

While I followed How to stack/layer two textures with alpha over each other with Material nodes? down to a t (other than the texture mapping), I tried other methods and end up still with a mix of the two textures than them being properly stacked. Maybe someone can help.

• – user1853
Jan 4 '20 at 21:22
• – user1853
Jan 4 '20 at 22:37

For Eevee, you might have to go the extra mile of creating 2 shaders and mix them together instead of doing it just for the textures. See here:

• Thanks, this helped a lot, especially, but not limited too, seeing which alpha should be used in the last mix shader FAC value! Jan 5 '20 at 16:18

Here's an example of combining B over A (both images have alpha channels)

To mix the RGB (color) information use the alpha info of B to control the color mix (this would be the proper Alpha Over operation)

To combine the alpha channels use a color mix node and the Add operation mode. Then plug the result to the alpha of the material node.

• This is still blending A & B what I am trying to avoid, but I still find this valueable and thank you for your thread contribution! Indeed I even looked into your thread Overlay more than one transparent images in one shader earlier. The more I look at your and the selected answer node, the more I think I chose the WRONG Alpha to put into the last shader FAC. Jan 5 '20 at 16:23

I got a same issue and found this question. The answer above works but a bit mess with many nodes, so I came out with a simpler solution.

In the following example, having the mouth texture as the base, the eyes texture is put on top of it.

Such overlay is done by Principled BSDF shader. Subsurface Color comes on top of Base Color, while applying alpha to the subsurface from Subsurface.

On the other hand, we need alpha data which makes it transparent in the area where both textures are transparent. It can be simply mathematically calculated. Create two Math node, which you can find under Converter category. Then, have one of those as Add to add the two Alphas of the textures.

At this point, the alpha data has some alpha value at the overlapping part of the two textures, which causes such area looks lighter color on the view. So, let's remove it by using the other Math node. Having it as Multiply with Clamp option, multiply the previously added alpha data with value 1.0. Now, you can use it for Alpha of the Principled BSDF shader.