- Home /
how to make tree/grass look like wind blowing
i wanted to make my game more realistic by making some tree or grass moving and i have no idea where to start with.pls teach me thx
Answer by BiG · Dec 21, 2011 at 07:20 AM
If your trees are created directly into Unity, you can use Wind Zones.
Answer by Zergling103 · Dec 21, 2011 at 09:01 AM
Use a vertex shader.
In the vertex shader, move the vertex's position by a random amount each frame. I'd use a texture lookup to get the amount of movement, (the texture could be tiling fractal noise) using the vertex's XYZ and time (see shader ref) for the lookup coordinate.
Although, I'm not sure if texture lookups are supported in vertex shaders.
To add realism, you could weight the tips of the branches at 1, and the bases at 0, and use them in the shader. That way leaf tips move more than the branches.
Answer by markl · Dec 21, 2011 at 07:06 AM
Hi best thing is either particle effects or vertex animation I would say. Particle effects are built into standard unity and vertex animation is supported through products like that great one Megafiers
How, exactly, would one achieve this effect with particles? I'm curious.
Its better to learn by video tutorial if have as words wont show a clear demostration
Answer by markl · Dec 21, 2011 at 09:38 AM
Can use the terrain editor it uses billboard particle effect...
http://unity3d.com/support/documentation/Components/terrain-Grass.html
Yeah, those particles don't move. $$anonymous$$ovement is the specific requirement here.
Answer by charnew · Dec 21, 2011 at 10:11 AM
It's the video here that demonstrates modifying trees, he's saying something about bend in the inspector: [link text][1]http://www.vtc.com/modules/products/moviePlay.php?size=Large&foldername=unity3d&sku=34092&id=89751&movieCode=0207&movieName=Adding+Trees&mode=flv but you have to sign up first