I made a terrain, painted it with some splat textures, then moved on to add some swaying grass. When using a "small bush" from the Unity package of foliage under resources just to test with, I noticed that once the area was previewed or run as a full app, that the grass would MOVE left/right instead of just tilting left/right to give it a swaying effect. How do I make the grass/other detail meshes sway/rotate slightly with the breeze, rather than being physically moved back/forth?
7 Answers
7I just saw a forum post that mentioned that detail meshes should have the vertex color alpha painted to determine how much wind affects them.
So the official solution is to paint your vertex color alpha black at the bottom, and then some value at the top depending on much wind should affect it.
This seems to be a documentation bug in the Detail Mesh reference page.
I’m still having this problem and watched the video and read all documentation I could find. I use blender and this is so ridiculous… no matter what I do, it doesn’t work. The detail meshes are still sliding even though I painted the weights correctly in blender. I wonder if I’m not exporting the weights properly… I wonder if anyone has actually figured this out for Blender. @ZeoBuzz @BjoUnity3d @glowingslab @KevalrOxy @God-at-play
Are you sure you painted vertex color alpha? Not vertex color rgb, and not skinning weights?
– AnomalusUndrdogHi! I created a free asset in Assets Store that let’s you to prepare any mesh to be used in Unity Terrain as a detail mesh with a correct wind behavior: Bush or Grass bend as Detail Mesh | Terrain | Unity Asset Store
I needed to paint them as "detail textures" instead of "detail meshes" to achieve the desired swaying behavior. User error =P.
that's not really a solution, since this means you can't have bushes and stuff (as they're meshes rather than just planes), unless you turn of the wind completely
– Steven-1Yes you can, but they have to be trees. To clarify, ZeoBuzz is talking about http://unity3d.com/support/documentation/Components/terrain-Grass.html
– WazYeah this is misleading. In a sense, the answer has NOT been solved. Detail meshes are in fact still broken under Grass rendering mode. Technically the solution is to not use Grass rendering mode at all, but instead set the rendering mode to VertexLit.
– God-at-playI have this problem too. As Steven 1 points out, is there a way to make the plants sway instead of moving?
Is there a solution to this - I love the look of the Terrain Detail grass renderer but the sway is uncontrollable. is there a way to control this by code? It rocks back and forth (root to leaf) even if you dont have wind setup in the scene. Or is there a way to get a similarly selectable dual colored render for terrain grass by some other means?
– kdagsjmI sort of solved this. What I did is use the tree panel and added the bushes and ferns as trees. This caused an info message in the console that said my billboards would not work if I didn’t change the shader to Nature Soft Occlusion. I went to each Bush/Fern model in the project panel and changed the shader to Nature/Tree Soft Occlusion Leaves. That gave me an acceptable result - a mesh with proper transparency and proper swaying behavior (doesn’t float across the ground). The warning message disappeared and billboards are working fine.
Anyone could confirm/deny this?!
– LeooGod at play is perfectly right, change the alpha on the vertex colors on your mesh, 0% no movement us at base and ramp up to about 60-75% for the top vertex's which are effected by the wind,, then re-import, remember to refresh your model import and re-assign the prefab to the detail mesh under grass.
– Jed_500So surprising that after 9 years, the manual still fails to mention this.
– AnomalusUndrdog