New Foliage Shader - How to setup a mask for the Subsurface Color Slot

Good afternoon.

I am new to setting up shaders for Unreal. Can someone point me in the right direction on how to set up a mask to only allow Subsurface color to work on the leaves on my branch…not the bark.

I have the bark masked out in Photoshop but I don’t know where to attach it in the shader.

Also adding in another texture for a mask is going to pull performance down. Can I just pack this new texture mask into the Alpha slot in my normal map texture? As my regular diffuse texture has the full alpha already packed. in.

Thanks folks!

make sure sub surface node gets color from leaves and black from stuff that not suppose be translucent

albedo - |
black - | lerp node - output is green for leaves and black for everything else
mask- |

yes you can use it as alpha for normal map

you can use green channel from your albedo as a mask if there is enough contrast

pull of green channel and use power, add and floor nodes to do sort of chroma key effect

Thanks for replying. Just to clarify.

Albedo and my Mask plugs into a Lerp Node then the lerp node plugs into the Subsurface Color slot?

I’m not sure why you have a Black node and a Mask node? Don’t they do the same thing?

Sorry I’m still learning much about shaders!

Thanks again Piroman.

As black i meant zero :slight_smile: yes it does mean the same, simpler version of that would be to multiply albedo with your mask or inverted mask if white is not translucent parts (one minus node)