Animated Grass

This is a simple technique, nothing special, it maybe works for one task but not for another. So feel free to improve, or change the technique as you like, to get the result you want. Also you will need to be familiar with max, I will not explain where the different tools are or how they work.
 

First draw a simple three point "Spline" in the front or left view as shown in the picture. Keep in mind to close the spline other wise it will not work correctly. Also don't click and drag since that produces a bezier spline, we want a linear spline.

Now go into sub-object mode, select all points, right click on one of the selected points to get into the quad menu and set them to be "Bezier Corner" rather than "Corner". If you don't do that you will later not get enough subdivisions for bending the spline.

Since we wanna use the max own scatter function we need to take care of the pivot. We want it to be at the bottom of the grass shaft. Normally we could use the adjust pivot tools but for objects we want to use with scatter there appears to be a bug; it will never use the pivot you have set, it will always use the original pivot that was created when you made the spline. So what we do is go out of sub-object mode and see where the pivot is at the moment, keep the position in mind or place a dummy at this position, go back into sub-object mode and move the vertex selection so the bottom of the shaft is at the same location as the pivot. Leave sub-object mode, check that the pivot is in the correct position. If so then go onto the next step.

Add a "Bend" modifier to the shape and set it to "Angle": 60.0, "Direction": 90.0 "Bend Axis": Y Also alter the center position in the sub-object mode so that the lower part of the shaft is parallel to the viewport grid. You can use different values if you like, it's up to you. They mean nothing. I just picked them because they produce a good result.

Put an "Editmesh" on top, just to generate the mesh and add also a "UVW" modifier on top of it. Try to align the UVW gizmo to the overall shape of the shaft to avoid the texture getting stretched. Simply do this by rotating the gizmo in sub-object mode. You can also use the Center, Fit or Align function in the modifier to make it more easy.

Clone the mesh and hide the copy. This is just if you wanna change something and don't wanna redo it all again from the start or you maybe want to do other versions of shaft bended with different values. Ok now add a material to it, I'm not going to go into any depth with that, just a simple "2 Sided", green coloured material will do the trick for now. If you feel like you need to add something more complicated go ahead. Small note, something you should use for a grass material is translucency to give it a more realistic look. Since the material structure of grass allows light to shine thru the shaft and be visible on the other site, same for shadows that are casted onto the grass, they are also visible on the opposite side.

Collapse the stack so we get a "Editable Mesh" or "Editable Poly" and now add "Scatter" to it. Scatter can be found in the create menu under "Compound Objects". Now we also need a distribution object where we want the grass to "grow" on. Create a "Plane" from the top or perspective view. Give it some more sub-divisions like 20x20. Add a basic brown-green coloured material to it.

For making it a little bit more organic add a "Noise" modifier to the plane. The value depends on the size of your plane, so just tweak them until they look right. Don't make it to extreme because that will make things more diffecult in the later steps and also needs to be done in a different way. More about that at the end.

Select the grass shaft. Now select the plane to be the "Distribution Object" for the grass, this button is just at the top of the scatter object. Set "Duplicates" to 100. You maybe need to adjust the scale as well depending on the size of your plane/grass. Uncheck "Perpendicular" and set the distribute type to "Area"

Go and change the "Rotation" to X: 10 Y: 784 Z: 10. Y is the shafts Z axis so keep that value quite high and irregular to have more natural results. Change "Scaling" to 10x10x10 and set "Lock Aspect Ratio". Under display options set "Display" to 5%, this will hide 95% of your grass in the viewport, so you'll have faster feedback. Check "Hide Distribution Object", this will hide the extra copy of the plane which was created by the scatter object it self. Scroll up and set "Duplicates" to 5000.

Next step: Animating. Add a "Volume Select" to your grass object and set it to "Vertex", go into sub-object mode and move the gizmo up so it's only selecting the top vertices. Turn on "Use Soft Selection" and change the "Falloff" so that all but the bottom vertices get selected. There is a slight color change that indicates if a vertice is selected or not, dark blue mean it's still selected, then it will change to a brighter blue, which means that it isn't inside the falloff range anymore. This is very important since in the next step we will apply another modifier which will use this selection to animate the vertices. If this is not set up correctly the grass will start shifting at the bottom.

After you're done with tweaking the soft selection add a "Wave" modifier on top of it and set it to "Amplitude 1&2": 5.0, "Wave Length": 35.0 and animate the "Phase" by setting a key at frame 100, value 3 or 4. Also go into sub-object mode and rotate the gizmo by 90 degrees to have the gizmo's deformed side in the Z direction other wise it will deform the grass in the wrong way. Again these values depend on the size of your object.

Make a copy of the wave modifier and add it on top again. Change the values like this for example; "Amplitude 1&2": 3.0, "Wave Length": 50.0 set the "Phase" value lower like 2.0 or 1.0 This will give a secondary animation to it and will vary the result a little. You could also go and rotate the gizmos to add even more variety. To add some small movement for the blades use a "Noise" modifier and set it to: check "Fractal", set "Strength" X: 6.0 Y: 4.0 Z: 6.0 and check "Animate Noise". Again, the values are depending on your object's scale.



Sample: animatedgrass.mpg

That's it actually, now all you need to do is tweak the settings to get the result you want.

Tip: For surfaces with grass that are not planar you need to use "Object" for the volume select, make a copy of the surface you want the grass to be on, collapse it, add a "Optimize" modifier with a high value and use "Solidify" it will extrude the surface along it's normals to give it volume. Solidify is a freeware pluging that you can find here: http://www.maxplugins.de/. Use this new mesh the same way you did with the original box gizmo. Another important thing is that scatter can only make a maximum amount of 65.000 duplicates, so if you need more simply make a copy of your grass object and change the seed value. How ever this technique is very memory intensive when using hugh amounts of grass as well as takes quite some time to render. You should not use this in big scenes if you have less then 1Gb of memory.

Fetching comments...

Post a comment