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).
- In the Hypershade window, first, click on the Work Area tab.
Then, select Lambert in the Surface list on the left.
- After this, click on Ramp in the 2d Textures list on the left.
- Delete the
place2dTexture Node (select and delete).
- 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).
- Select a Noise in
the 2d Textures list on the left.
- 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
- Now go inside the
Attribute Editor for the Noise node and change those attributes values :
- Ratio=0.198
- Frequency Ratio=1.7
- Frequency=64
- Noise Type=Perlin
Noise
- 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.
- Result (Hypershade, Work Area):
Now that we have the color shader
for the grass we can start working with Maya Fur.
- Select the sphere
and attach to it a new Fur Description ("Rendering" menu:
"Fur->Attach Fur Description->New").
- You obtain white rigid Fur on the sphere.
- 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).
- 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:
- Density=10000.
- Map Width=512.
- Map Height=512.
- 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.
- Put a quite dark
green for "Base Ambient Color" and "Tip Ambient
Color".
- Base With=0.1.
- Tip Witdh=0.06.
- Scraggle=0.2.
- Clumping=0.05.
- Details->Base
Color->Noise Amplitude=0.2.
- Details->Tip
Color->Noise Amplitude=0.2.
- Details->Specular
Color->Noise Amplitude=0.3.
- Details->Length->Noise
Amplitude=0.6.
- Details->Baldness->Noise
Amplitude=0.3.
- Details->Inclinaison->Noise
Amplitude=0.3.
- Details->Roll->Noise
Amplitude=0.2.
- Details->Tip
Opacity->Noise Amplitude=0.2.
- Details->Base
Width->Noise Amplitude=0.1.
- Details->Tip
Width->Noise
Amplitude=0.1.
- Details->Scraggle->Noise
Amplitude=0.2.
- 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.
- Create a hair system
("Dynamics" menu, "Hair->Create Hair->options" and
choose "Output: NURBS curves").
- In the Outliner select the
hairSystem node (hairSystem1 normally).
- Apply it as a constraint
to the Fur system ("Fur->Attach Hair Sytem To Fur->xxx"
with xxx the Fur Description node -- probably furDescription1).
- Open the Attribute
Editor for the hairSystemShape and change those parameters:
- Dynamics->Forces->Gravity=-.5
(it prevents the grass from falling down).
- Turbulences->Intensity=0.1.
- 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
|