Alpha texture vs layer (Solved)

Good morning,

I’m working on a scene that includes vegetation. Leafs have been done with image textures, noded like this:

I need to render the scene in different layers. For the layer of the leafs itself, the transparency works well,

…but when these leafs are masked in other layers, the render doesn’t take the transparency in consideration: it contours the mesh of the leaf, rather than the leaf around the alpha.

This is a .blend file exemplifying the problem. In viewport render the image texture has the alpha proper, but when trying to mask it (click “render image”) it masks the plane mesh, not the alpha from the image texture.
LEAF-BA.blend (841 KB) LEAF-BA.blend1 (841 KB)

I couldn’t find a proper answer on how to solve this! If someone can help I would be gratetful!

Enough transparent bounces for the renderer, transparent film, and combining them with alpha over works every time.

Why it doesn’t work for you, no slightest idea, as you’re concentrating on describing the issue instead of providing the means to find the cause of the problem. In other words, a reduced example .blend to reproduce the problem.

Thanks for your support, JA12. Here you have a .blend with the example (I also edited it in the original post)

If you check “render” in the viewport, you will see that the leaf looks ok. When rendering the image as it’s set up right now (with the masked leaf) you will see the whole plane masking, instead of the leaf contour.

LEAF-BA.blend (841 KB) LEAF-BA.blend1 (841 KB)

Thank you so much for your support,
could you show me what’s coming to fac? like showing the entire tree?

There’s no hidden nugget of information required to make it work. Like shown, instead of using mask layer, the leaf material is set to use holdout instead.

The node tree is zoomed in so the node texts are clearly visible, and instead of reordering the whole tree, a reroute is added and labeled to indicate what is connected (which takes two hotkeys).

1 Like

That’s fine,

I asked cause I couldn’t get the texture to be the same when adding the holdout (I am new with nodes), but it works perfect for the alpha mask, so I created a new file for those renders I require it.

Thank you for your awesome support @JA12