Grass From Particles and Weight Painting

December 10, 2007 2:33 am

Grass from particles and weight painting

Here's a technique I use to make some nice looking grass for ground cover. You could apply this technique to other applications as well.

We'll start by making a simple 12x12 grid for our patch of grass. Start with the 3D cursor at 0,0,0. If it's not there already, you can press CTRL-C to move it to the center. Pressing 'C' will center your view on the cursor. Switch to an over head view (7 on the numb pad should give you an over head view).






Press the Space bar to bring up the popup menu.

Add – Mesh – Grid.









We'll go with a 12 x 12 grid to keep it simple. Change the X and Y values to 12 and click ok to continue.




Our 12 x 12 Grid as seen from an over head view.


From here, we're going to create 2 vertex groups. One we will call 'Length' and one we will call 'Amount'









With your grid selected, switch to edit mode. Under the Link and Material tab, you'll see Vertex Groups. Click 'New' and name the first one 'Length'. The default 'Weight' will be 1.0. With all of your vertexes selected (As show above), click 'Assign'. This will assign all of your vertexes to the group “Length” with the default value of 1.0.









Click on 'New' and create a new group with the name of 'Amount'. The default weight will be 1.0. With all of your vertexes selected again, click assign to assign them all to the group “Amount” with the Weight of 1.0.

The Weight value goes from 0.0 to 1.0. This is really nothing more than a percentage. 1.0 equaling 100 % and 0.0 equals 0% of course. Keep this in mind as we move on.

If you switch modes to “Weight Paint” now, you will see your grid turn Red if you followed the instructions carefully. This is correct and shows that all of the vertexes carry a value of 1.0 (100%). This is showing the value of the 'Amount' vertex group since that is the last group that we had selected before we switched to 'Weight Paint' mode.





Let's start the particles now.




With your grid still selected, switch to 'Object' mode and then switch to the 'Physics Mode' as show in the image above. You should see the 'Particles' tab. Click 'New' to start a new Particle effect.





The first tab, 'Particles', basically deals with how many particles we have, how long they 'live' and what form they're in. These values can always be adjusted later to suit your liking. For now, raise the default amount up from 1000 to 2500 or so. In our case, this will be how many blades of grass we want. For our grass, we want to select 'Static' and not 'Animated' since our grass won't be living particles. Select 'Vect' so our particles will be lines instead of just small dots. For 'Vgroup', this will be the name of our one vertex group which we named 'Amount'. Our vertex group, with their weight values (Percentages remember), will let us adjust the amount of grass in different areas of our grid. Right now, our total amount will be 2485, with our vertex weights (percentage) adjusting that value from 2485 (100%) down to 0 (0%). I don't have it selected here, but I always click the “Rand” button just above the Vgroup space. This will mix up the particles so they don't look so 'uniform'.




Our next tab under Particles is labeled 'Particle Motion' and deals with just that. Since our grass will be 'Static' and not 'Animated', in our case it will deal with the length of our grass. The 'Normal' slider will adjust the length of our particles. Once you adjust it up a few clicks past 0, you should see your particles start to spring up in your 3D view port. Set it at .030 for now. Again, this can be adjusted later to suit your needs. Here again, I bump the 'Random' value up one click to vary the length of each particle by a small amount. For “Vgroup”, you guessed it, that's where we type in the name of our group which we will used to dictate the length of our grass. Type it in here, 'Length'. Make sure your names our the same here as you type them in under the vertex group name. Upper and lower case does make a difference.







Here's what you should be looking at up to this point. I'm still in 'Weight Paint' mode here as you can tell by the red grid. All of my vertexes are even in length and evenly space with a slight random amount which we added in there.

Let's cut the grass now:



With your grid still selected, switch back to 'Edit Mode' and 'Weight Paint' mode for you 3D view port. You should be exactly as I have it shown above. With the 'Link and Material' tab to the left, we will be able to easily switch back and forth between our 'Length' group and our 'Amount' group by the selector next to it's name. With the 'Paint' tab to the right, we can adjust the value of our brush for 0.0 (0%) to 1.0 (100%) and any value in between. The 'Opacity' will determine how quickly our brush will change the value, 1/8 being very slowly while 1 will be very quickly. The size will determine the size of the circle for your brush.

Set your weight to ½ and your opacity to ½ . Set your vertex group to 'Amount' and try painting on you grid. It will show up as green on your grid and it is reducing the amount of particles in that section to ½ or .5 (50%). Yellow shows a setting of ¾ or .75 (75%). Light blue represents ¼ or .25 (25%). Dark blue represents 0.0 or 0%. The 0% is clearly evident since there are no particles remaining in that section.

Let's switch over and adjust the 'Length' now. Under the 'Link and Material' tab, change your vertex group from 'Amount' to 'Length'. As you switch, you see the grid return to all Red. This shows that all of the vertexes in the 'Length' group are still at a weight value of 1.0 (100%) and since we are using this value to adjust our length, all of our particles are still a 100% of the 'Normal' value that we set (.030).



Let's adjust our weight brush to ½ again and cut some of our grass down in half. (50%).

I made a cut of 50% across the middle here. A 75% (yellow) cut behind it. A 25% cut (light blue) in front of it.

I cut the front row all the way down to 0% (or close to it). That's the dark blue row in front.

You should still be able to notice the difference in the amount of grass even though we cut the length down. My front right corner was 0% for the amount and as you go across to the front left, it was still at 100% (Red) for the amount.

By now, you should have a pretty good idea on how to work with particles using weight painting. You can mix things up now to try and get a more random or natural looking patch of grass.








You could go back now to the 'Physics Mode' where you started the particle effect, and increase the amount. This will increase the amount of our grass, however, the percentages we 'Painted' on our grid will still be in effect.

You can adjust the 'Normal' amount under the 'Particle Motion' tab. This refers to how fast the particle travels, but in our case, since they are 'Static' and the 'Vect' button is selected, which shows them as a vector, it will adjust the length of our grass. Again, the percentages dictated by our 'Length' vertex group weight will still control the length of various sections of the grid.

Let's give the grass a slight downward curve as if gravity is pulling down on it. This is simple to do under the 'Particle Motion' tab.








You'll see 3 values, X,Y,Z listed under 'Force:' Z is our vertical Axis. Changing this value to a negative number will draw the grass (particles) down along the Z axis.

You could do the same for the X or Y axis if you want the grass to lean in one direction or another.

-0.08 for my taste adds a realistic curve.









Let's adjust our grass color. Press 'F5' for the shading menu and press the 'Materials' button. Click 'Add New' to start a new material for our grass.

Under the 'Preview' tab, the 5th button down will give you a Particle preview. Select that view.

Select the 'Ramps' tab and press the 'Colorband' button.

The default values show 2 colors. The one on the left has the Alpha value set all the way down so the base color will show through. The one all the way to the right is a Cyan color. The color markers are at each end of the Colorband by default. They are represented by a vertical black and white line.

If you click on the left one, you can adjust it's alpha value back up all the way. Click the black box right above it to change it's color. Click the bar to the far left to change it's color as well. Click the 'Add' button to add more colors to the color band. You can also 'Left Click' and slide the bars around to adjust their overall effect on your particles.


I've moved mine around a bit in my example, added one more for a total of 3 and changed their colors to brown, dark green and green.

Next, we can adjust the shape of our particles by pressing the 'Strands' button under the 'Links and Pipeline' tab.

These options are fairly simple. Start width of the strand, End width of the strand and the Shape which defines where the transition between Start and End occurs. Play with these values a bit to see their effect on your grass. Each time you adjust them, click on the 'Shading' button again to update the preview window.



After all of these options, you should be able to come up with some fairly good looking grass.

If you have Yafray installed, things will look even nicer.

Good luck!
















All supporting images are copyright, and cannot be
copied, printed, or reproduced in any manner without written permission.

Special thanks to Renderosity artist, Reddog9.
Be sure to check out Reddog9's tutorials and Freestuff. Also, be sure to visit Reddog9's Renderosity Gallery, as well as his personal Web Site.

January 14, 2008

Please note: If you find the color of the text hard to read, please click on "Printer-friendly" and black text will appear on a white background.

Article Comments

No article comments have been posted. Sign In or Register to share your thoughts.

Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.