Help Vertex Displacment Based On Vertex Colour

Hi all,

I trying to make a tree look like its in the wind with moving leaves, so far I’ve followed a few tutorials this one but it effects the whole tree.

What I need is it to be based on vertex colour from model, I’ve filled the leaves verts Green and the trunk Red by vertex colour, how can I stop the vertex displacement from happing on the truck that is the using red vertex colour? I’m really stumped on this one new to Unity graph :frowning:

Thanks in advance! :slight_smile:

You can multiply your vertex displacement logic by the green component of a vertex color node to have it only affect the leaves

Hey, welcome to the community :wave:

If you show what you’re doing in the shader, I can help you figure out how to fix it. But typically you would just mask the movement by whatever channel you are want to affect.

So, set up your vertex movement stuff and then multiply it with the Green channel of your vertex colours to mask it.

You might want a little bit of sway on the branches and the thinner areas of the tree as well. So, you can mix it in with your leaf movement with some multiplier or a bias to control it.

I assume you’re using Unity and Shadergraph?

Hi Sifa,

I figured it out in the end, at the end I was able to mask it out like you said by the green channel.

Thanks for the help! :slight_smile:

1 Like