Grass Simulation



Valid for: Maya Unlimited 2008 2009.
Tools used: Fur, Hair.
Goal: creation of grass with Fur and dynamic simulation.



Global overview:

    In this tutorial we are going to see how to use and setup Maya Fur to create grass and how to animate it.

Grass Creation:

Preparation step:

We need :
  • A NURBS sphere (Radius=6).
  • A NURBS plane (Width=16).
  • A Directional Light and an Ambient one (both Intensity=1) (Create->Lights->Directional Light; Ambient Light)
  • 2 differents lamberts (Window->Rendering Editors->Multilister):
    • A regular Lambert with a dark green color. Assign it to the sphere and the plane.
    • A special Lambert for the grass color which we describe in the following step.


Grass setup:

    First we need to create the grass color Lambert. For this open the Hypershade Editor (Window->Rendering Editors->Hypershade).
    1. In the Hypershade window, first, click on the Work Area tab. Then, select Lambert in the Surface list on the left.
    2. After this, click on Ramp in the 2d Textures list on the left.
    3. Delete the place2dTexture Node (select and delete).
    4. Left click on the outup zone of the Ramp (right arrow at the bottom of the icon) choose outColor->outColor and connect it to the color in the input zone of the Lambert (left arrow in the bottom of the icon).
    5. Select a Noise in the 2d Textures list on the left.
    6. We now want to connect the outColorR output of the Noise to the vCoord of the Ramp. For this, open the Connection Editor (Window->General Editors->Connection Editor), select the Noise node in the Hypershade and click "Reload Left" in the connection Editor, select the Ramp in the HyperShade and click "Reload Right" in the Connection Editor. Select "outColor->outColorR" in the left column and "uvCoord->vCoord" in the right column to create the connection between both attributes. You can see the result in the Hypershade. You can now close the Connection Editor
    7. Now go inside the Attribute Editor for the Noise node and change those attributes values :
      1. Ratio=0.198
      2. Frequency Ratio=1.7
      3. Frequency=64
      4. Noise Type=Perlin Noise
    8. Go inside the Attribute Editor of the Ramp node and change the colors. There is no need to do complex things, you only need one dark green color at the botton and one light green color at the top. At the end if you are not happy with the grass color it will be possible to play with those values and do more complex things.
    9. Result (Hypershade, Work Area):    
Now that we have the color shader for the grass we can start working with Maya Fur.
    1. Select the sphere and attach to it a new Fur Description ("Rendering" menu: "Fur->Attach Fur Description->New").
    2. You obtain white rigid Fur on the sphere.
    3. Select the plane and add the same Fur Description to it ("Fur->Attach Fur Description->xxxx" with xxxx being the name of the Fur Decription you just created -- normally, FurDescription1).
    4. Tune the Fur Description parameters to improve the result using the Attribute Editor. Click on the Fur Description tab(FurDescription1 in our case). Here are the parameters we used:
      1. Density=10000.
      2. Map Width=512.
      3. Map Height=512.
      4. Open the Hypershade, display the network for the grass color lambert and drag and drop the Ramp node on "Base Color" and "Tip Color" attributes.
      5. Put a quite dark green for "Base Ambient Color" and "Tip Ambient Color".
      6. Base With=0.1.
      7. Tip Witdh=0.06.
      8. Scraggle=0.2.
      9. Clumping=0.05.
      10. Details->Base Color->Noise Amplitude=0.2.
      11. Details->Tip Color->Noise Amplitude=0.2.
      12. Details->Specular Color->Noise Amplitude=0.3.
      13. Details->Length->Noise Amplitude=0.6.
      14. Details->Baldness->Noise Amplitude=0.3.
      15. Details->Inclinaison->Noise Amplitude=0.3.
      16. Details->Roll->Noise Amplitude=0.2.
      17. Details->Tip Opacity->Noise Amplitude=0.2.
      18. Details->Base Width->Noise Amplitude=0.1.
      19. Details->Tip Width->Noise Amplitude=0.1.
      20. Details->Scraggle->Noise Amplitude=0.2.
      21. Details->Clumping->Noise Amplitude=0.2.
    Result (3d view and a rendering):





Animation of the grass:

We now have nice grass but it is static. We can add a bit of movement using Maya Hair. For this part we will only work with the plane because we can only have one object per Fur Description with the following technique. We thus delete the sphere.
  1. Create a hair system ("Dynamics" menu, "Hair->Create Hair->options" and choose "Output: NURBS curves").
  2. In the Outliner select the hairSystem node (hairSystem1 normally).
  3. Apply it as a constraint to the Fur system ("Fur->Attach Hair Sytem To Fur->xxx" with xxx the Fur Description node -- probably furDescription1).
  4. Open the Attribute Editor for the hairSystemShape and change those parameters:
    1. Dynamics->Forces->Gravity=-.5 (it prevents the grass from falling down).
    2. Turbulences->Intensity=0.1.
  5. Now if you play the animation the grass will move a little bit. The simulation can be improved by playing with all of the attributes of the hairSystemShape node. Have fun!

Final result with video :



Video of grass animation : grass simulation with very small turbulences. The result is not very correct for grass ... it looks more like seaweeds but it's just a question of correctly adjusting the parameters.


That's all folks !

Now you need to experiment to understand how to properly use the attributes.



Copyright © Olivier Dumas
Tutorial written by Olivier Dumas