Vegetation animation on non-terrain mesh? [YES]

Hello, I’m going to have to use vegetation on a non-terrain custom mesh. And I understand (but correct me if I’m wrong) that Unity’s automatic grass animation (softly blowing in the wind) wouldn’t work in that case.

So my question is: what would be the best way (and hopefully the most efficient one) to still get grass/bushes procedurally animating, so they don’t look like they’re made out of concrete?

Well, I finally got around to tackling this issue and I’m happy indeed to report that yes, it is possible to benefit from Unity’s grass/wind bending system even on custom terrain meshes!

@Lil_billy: Well, it took me about an hour of hard thinking to come up with a simple system. But that’s because I’m still fairly new to Unity shaders, I guess.

For those interested, I basically tweaked the hidden “WavingDoublePass” Unity shader (used by the engine for grass/foliage waving) so that it actually supports standard textures with alpha.

Then I just applied a material based on this shader on my custom bush model. And I simply animate the built-in waving frequencies of the material over time and voila! Again, this is no complex new system, but rather a simple extension of the built-in system.

The goal being that I can now put procedurally animated vegetation on any mesh, not just official Unity terrains.

And a picture of my WIP project, since we’re at it: