Combining Foliage Opacity Mask with another Mask

I would like to make my foliage invisible below a boundary on the Z axis to create an automatic transition or fade out.

Currently, my approach is to create a material function that gives me a 3D box mask that cuts off everything below 0. It works great, but I’m having trouble combining it with the opacity mask from the Foliage. With the Append Node, I unfortunately lose the mask for the grass itself.

Is this the completely wrong approach for such a scenario? Does anyone have any experience with this?

Thanks for your help in advance!

I’m guessing the function is ok, but can you show how you’re combining it with the rest of the material?

Oh, my mistake! Forgot the second picture.

But right now it is simply an Append node … I was just guessing and trying … :slight_smile:

Use GetMaterialAttributes and SetMaterialAttributes nodes :slight_smile: You will save yourself from these ugly graphs :slight_smile:

Thank you @Rawalanche :slight_smile: Looks more organized now!

Yep. You no longer need to do pass through connection of the attributes you are not interested in modifying :slight_smile:

I think I found a solution:

Using a Linear Interpolate to blend between the original Opacity Mask and a value of 0 with the Box Mask as the Alpha Value.