tutorials.render-test.comtutorials.render-test.com/worddocs/grass pflow.docx  · web viewand move...

21
Growing Grass - PFlow In this tutorial we are going to take a look at a method of using Particle Flow to grow grass or any foliage with a bit of imagination and a few adjustments based on what you wish to grow. We'll start with grass because it's simple. First things first, since I am not going to spend time talking about how to model blades of grass and focus on using them in a particle effect you can download the starter file here: http://animation.diclementi.com/tutorials/grass_start.max Open the file and what you should see is a plane with a slight noise added to it which will represent our ground, and a group of 4 variations of grass blades grouped together. Anyone who has paid attention to me in classes etc. before may now remember that I said Group is a horrible horrible thing in 3DS Max. Which is very true for the most part, but for this it works pretty well. First thing we are going to want to do is to create an animated grayscale texture to give our grass some character as it grows out from a point of origin.

Upload: nguyenthuy

Post on 09-Apr-2018

219 views

Category:

Documents


5 download

TRANSCRIPT

Growing Grass - PFlow

In this tutorial we are going to take a look at a method of using Particle Flow to grow grass or any foliage with a bit of imagination and a few adjustments based on what you wish to grow. We'll start with grass because it's simple.

First things first, since I am not going to spend time talking about how to model blades of grass and focus on using them in a particle effect you can download the starter file here:

http://animation.diclementi.com/tutorials/grass_start.max

Open the file and what you should see is a plane with a slight noise added to it which will represent our ground, and a group of 4 variations of grass blades grouped together.

Anyone who has paid attention to me in classes etc. before may now remember that I said Group is a horrible horrible thing in 3DS Max. Which is very true for the most part, but for this it works pretty well.

First thing we are going to want to do is to create an animated grayscale texture to give our grass some character as it grows out from a point of origin.

Open your material editor (M) and select the first empty texture slot in the file, you will notice that there is a multi-sub object texture full of about 6 different shades of green.

They are just standard textures which we will use to vary the color of our grass blades, but the first texture slot in the editor is free and clear.

Select the empty texture slot.

Then set the Material ID to 1 for this texture.

Then in the Diffuse channel box, add a Gradient Ramp.

Then apply the texture to your plane and we will animate the gradient.

In the gradient type drop down select Radial.

Then switch the color tabs around by double clicking on them so that the one on the left side is white, and the other two are black.

Then move the middle tab all the way over right next to the white tab on the left.

Now turn on your auto key.

and move the timeline scrubber to frame 50 or so.

and then move the middle tab of your gradient all the way over to the other side just before the tab on the right.

If you scrub back and forth now, you should see the white area in the center growing towards the outer edges of your plane.

Turn your Auto Key off.

Then adjust the noise settings just below the gradient itself to add a slight bit of variation to our growth area.

Perfect, now we can hop right into Particle View and start working on our particles.

Press 6 on keyboard above the letters, or find Particle View in the Graph Editors menu at the top of your screen.

Once in particle view, click and drag to the empty light grey stage area an Empty Flow from the depot list below.

-->

Followed by a Birth operator, and then connect the two via the blue node dongle under your PF Source box.

Click on the Birth, and adjust its settings in the Command panel to the right.

Emit Start at 0, and Stop at 75. This will give our grass a few frames after our texture finishes its animation to fill in the gaps.

To start give yourself a couple thousand particles, we will increase this much more later.

Then drag and drop a Position Object operator from the depot just between the Birth and the Display in our Event01 box.

Then adjust the Position Object settings to the right.

Click on the By List button and add the Plane01 to the Emitter Objects.

Mark Density By Material and double check that it is set on Grayscale.

Delete Particles if Location is Invalid must also be checked so the grass will only grow in the lighter colored region of our plane.

Now drag and drop a Shape Instance from the Depot to in between the Position Object and the display.

This one will allow us to change our particles into the blades of grass.

Adjust the settings of the Shape Instance to the right.

First click on the Non button and then click on the group of 4 blades of grass to add it as the Particle Geometry Object.

Check Group Members (this is why we had the 4 blades grouped, Particle Flow will split them apart for us without having to do any extra work.

Reduce the scale to about 10% and give it a variation of 20% or so. We want our grass to start small and grow in.

Make sure Multi-Shape Random Order is checked as well so you don't get the same blades of grass in the same spots every time. It mixes them up a bit better with this.

Before we go any further, select the Display 01 below the Shape Instance, and set the first drop down to Geometry so we can see how the blades of grass look.

You should have some very small particles that now look like blades of grass sticking out of your plane.

Now let's make them grow.

Add a Scale to just before the Display 01 in your Event01 box.

Then adjust the settings to the right.

Set the drop down to Relative Successive, so that the grass grows by a certain percentage over each frame.

Then make sure the Scale Factor "Constrain Proportions" box is unchecked.

Make the X and Y% 104. and the Z% at 105. So the grass will grow taller quicker than it grows thicker by just a little bit.

Scrub down your timeline a little ways and see what happens.

Not bad, it is looking a bit super straight up and down to me, so let's add a Rotation between the Scale and the Shape Instance.

At first it will look as though it has messed everything up, but we will fix it in the settings to the right.

Make sure the dropdown menu is set to Random Horizontal, this should straighten our grass right back up.

Then add a fairly low Divergence number like say 20 or so, and you will see your grass start bending in a few different angles without laying down full or standing straight up for every blade.

Much better

If you scrub down the timeline all the way to the end, you might noticed that the grass in the middle starts to grow a little out of hand.

To fix this, we are going to add something that doesn't get much attention called a Scale Test to the Event 01 box.

The scale test waits for the grass to reach a certain size and then sends it on to the next event.

Adjust the settings for the Scale Test to the right.

We can stop the grass from growing by simply adding a new Display operator to the light gray stage area, and connecting the blue node from our Scale test to it.

Set your dropdown for the new Display to Geometry just like we did for the first one, and when you scrub down the timeline as your grass reaches the 115% size from the original model, the grass will stop growing and turn the color of your new Display. Like this:

Once the blades change color, they will no longer grow, but the ones who haven't reached their mark yet will continue to grow and fill in.

Now all we have to do is add a Material Static to the very top box in our flow chart, just under the Render 01. We add it up here so that it carries all the way through the entire flow chart.

Then adjust the settings and drag and drop the Grass texture I had already made for you into the None button.

Once the Material grass1 has been assigned be sure to mark Assign Material ID, select random so that it chooses which blades get which shade of green randomly, make sure the # Sub-Materials: matches the grass texture, which should be 6 shades of green.

And finally double check that Per Particle is set to only 1, or your grass will be funny looking.

Then you can return to your birth and up the amount of particles from 2000 to whatever looks best in your scene. I have used 20,000. Be careful though as instancing geometry can crash your computer fairly easy if it is not a great machine.

Now you can add another sub-object texture to your ground and make it look like dirt, but as long as the gray scale stays as Material ID 1.

To do this select the first of our textures, the one we built the grayscale in, and then click on the button that says Standard.

Select Multi-Sub Object from the list and hit OK.

When the popup menu appears make sure Keep old material as sub-material? is selected and then hit OK.

Then inside the parameters click on the Set Number button.

And type 2, then hit ok as we don't need the default 10.

You should see your gray scale sitting in the #1 spot still, and a new empty texture in #2. Click on the texture for number 2 to adjust it.

Here you can add a soil texture or whatever you like, for this demo I'm just going to change the color to a brown in the diffuse channel.

Now go select your plane with the grayscale on it, and in the modify tab, add an Edit Poly Modifier to the stack.

This will let us adjust which texture the plane's polygons show.

Select the Element sub Object and make sure to click the plane so it all shows up red.

Then scroll down in your edit poly settings until you find the rollout labeled Polygon: Material IDs, and simply change the number next to Set ID: to 2 and hit Enter.

Which will change what displays on the polygons to our brown, but the grayscale will still be controlling our particles silent and invisible.

That's it, now you can render your animation and see what it looks like.

for an example you can see a video of the effect here:

http://animation.diclementi.com/grassgrow.html

Just add lights, textures, and scenery and you are set!