I wanted to make a growing roots shader for the tree enemy of my thesis. And I found some cool references(Link) and tutorials( Link1, Link2) on Twitter.
1.Growing effect
I used Opacity Mask to achieve the growing effect. First, I took a float subtracted from the V of Texture coordinates and connected the output to Opacity Mask, in that way I can control the proportion of black and white by adjusting the float. In order to mask out the top of the mesh, I added a OneMinus nodee.
2. Shrink the tip of the roots
I multiplied VertexNormal with a float, then connected the output to Local Vertex Offset to make the vertices move along their normal direction, the mesh could shrink or expand when I adjusting the float value.
I wanted the end of the cylinders to form the tapering shape, so I gave a Smoothstep to the UV-y. In that way, I can turn the parts that I want to be the tip to white, then it worked as a pinch mask when I multiply it with the mesh shrink and expand effect.
3. Ground Crack
I wanted the ground to crack when the roots grow out of the earth. To do so, I made the ground crack animation in 3ds MAX (the RayFire plugin is really handy to make ground cracks). Then I wrote a script to make the cracking animation only play when the“grow”value is in a certain range.
Comments