Let’s welcome Jonathan Lampel to Blender Cookie
Jonathan is the artist behind the Cabin in the Woods image below and will run through the similar techniques he used to create the grass in the image.
Tutorial: Learning how to create realistic grass in Blender
Hi guys, and welcome to this written tutorial about creating realistic grass in Blender. This blender tutorial is meant to teach you how to create and add grass to whatever scene you need, by showing you a simple and fast technique.
A few things to note before starting:
This tutorial is going to be using Cycles, but you could take the technique to Blender Internal if you wanted, but you will not be able to follow along exactly while creating the materials. Personally, I just find Cycles easier and faster for a realistic result.
Adding any kind of grass to a scene takes a lot of computer power. I will show you some tricks to save memory and render time, but there is no way around the fact that grass needs to be very dense in order to look good.
Part 1: Introduction to Grass
While this part may not be necessary, I would advise that you do it if you want to ingrain in your head how to make your grass look natural.
The best way to learn something is by observation – so that’s what you’re going to do! If you can, take a short break right now, and go outside. Take a few minutes and observe the grass. Pick a few different types of blades and look carefully at them. This may seem silly, but you need to know what real grass looks like in order to try and fake it in 3D.
Part 2: Setting up a Scene
So now that you know what grass looks like in real life, let’s try to make it in Blender. Now, if you look up a tutorial or picture of grass in Blender, the same kind of scene usually pops up:
(figure 2-1. One of my sad earlier attempts at grass)
Now, it may or may not look more realistic than this, but they all seem to look the same. When someone wants to make grass, they just make this massive field of the same type of grass. To be honest, this composition just gets old after a while, so figure 2-2 is a scene that I have created that will be our starting point. I found that putting grass in a realistic context really helps it look more realistic.
(figure 2-1. One of my sad earlier attempts at grass)
If you are not a Citizen Subscriber, and cannot download the scene from the source files, don’t worry! I will show you some basic things here, but the creativity is up to you.
You can see that my scene is lit by only one sun lamp (figure 2-3), which is at an angle. For a nature setting, I would never have the sun coming from directly the front, back, or either side unless necessary. That would just feel unnatural, so put it at some sort of angle. I also colored it slightly yellow, because the sun is slightly yellow. Simple enough! (figure 2-4)
The background I used is just an equirectangular image texture available from heiwa4126 which as a limited creative commons license. I am using it as an environment texture because that gives the scene some nice colored bounce lighting.
One last thing that I want to add if you are not using this file is that if you are making a naturally occurring field, please add a few bumps or hills because nature is never 100% flat. For cultivated ground, you can do whatever you think best.
Part 3: Creating the Mesh
Ok, now let’s actually make some grass! First, go to a layer you know you will not need. I usually just use the last one. Then, add a plane and rotate it 90 degrees on the X axis while in object mode. We do this in object mode to change the local coordinates so that when we create a particle system, the grass will point upwards.
Next, go into edit mode take the top edge, extrude it, and scale it down. Do this about 3 times, and use Alt+M to merge the top edge to create a point. Make sure the origin is at the base of the blade. Scale down along the X axis to make it thinner. Then, move the edges around the X and Y axis until you get about the same result as in figure 3-1:
(figure 3-1, front and side view)
Before we duplicate this to make more grass, we need to set up a couple things first to make everything easier in the long run. First, set the grass to smooth shading. Rename it to “grass blade” if you want to keep your objects organized.
Give the grass a placeholder material, as well as create a group for it (as seen in figure 3-2). We will get into materials later, but putting it in now will save you from having to add the material to all the grass blades one by one. If you would like, you can add a subsurf modifier as well, but it is not really necessary unless you are doing a close up.
Now we are ready to give the grass some variation. Duplicate the grass and tweak some edges, but still keep them roughly the some shape. Create 3 different copies of the original, and you should end up with something similar to this:
Because we already added the original to a material and group, we don’t need to go through and add each one individually.
Before we move onto using particles, let’s create two more types of grass. To do this, duplicate one piece of grass, rename it, and add it to a new group. Make one type a little more thin and bent (call this “long grass”), and the other thin and tall (this type should be “tall grass”). You should end up with three different types of grass, all with four different variations. Each type should have its own group and name. They should look similar to this:
(figure 3-4, side and front view)
Part 4: Using Particles
Cool, now that we have the grass mesh all finished we can move on to particles. Go back to the first layer, and give the ground a new particle system with the type ‘hair’. Rename both the system and settings name to ‘grass’, and be sure the ‘advanced’ option is checked.
In the Render settings of the particle system, choose group, and then ‘grass’ as the dupli group. Settings should look like figure 4-1:
The following settings dealing with the particle systems can be very different than what I have done depending on the scene. Below are the settings that I used for this particular image, but they will vary depending on what kind of grass you are trying to create. For more experience, play around with each setting and decide on whatever looks best in your scene.
Now let’s make the grass the right size. In the ‘Physics’ settings, change the size to 0.01, and the random size to 0.3.
The grass looks alright now, but it definitely needs some variation – it is much too uniform. In the Velocity settings, give it a random of 0.25. This will make sure that the grass will not all be standing perfectly strait up. Don’t set it too high though, or it will change the size.
Check the box labeled ‘Rotation’ and set both the phase and the random amounts to 1. The random value does not work if the phase is set to 0.
At this point you may have noticed that we have a problem: the grass is growing through the path and in places where we don’t want it. To fix this, we need to add a vertex group to the ground. In the ‘Object Data’ tab, add a new vertex group and name it… yep, you guessed it: ‘grass’. Then switch from object mode to weight paint mode.
Remember that when weight painting the denser the mesh is, the more accurate you can be. If you need, subdivide the ground a few times in edit mode.
Now, we can use the ‘add’ brush (at a strength of 1) to paint red where we don’t want the grass to be. It doesn’t have to be exact, but try to be careful because you won’t want bald spots, nor do you want grass in the stones.
Ok, now go back to object mode. In the particle settings, inside the ‘Vertex Groups’ panel, choose ‘grass’ for the density. Check ‘negate’ to have the grass outside the path and not inside.
Now, the grass looks great but it is much too sparse. To fill in the space naturally we need to increase the emission to 7,000 but also add some children. Remember that if you only increase emission you will get no clumping. If you have little emission particles but lots of children, you will get a few very thick clumps. In most cases you need a nice balance.
In the ‘Children’ panel, choose ‘Interpolated’. This will give a more even spread than ‘Simple’.
Choose to display as many as you think your computer can handle. Mine can only handle about 5, but I can preview 20 in cycles. Change ‘Render’ from 100 to 25.
The roughness values help give the grass more variation. The uniform roughness seems to add a noise texture to the emission direction of the children. Go into top view and set this value very high if you want to see what I mean. Random roughness is used more in hair strands, but it can still be useful here to give the grass a little more variation.
Set the children and emission settings to what I have below in figure 4-7 (except display if you have an old computer):
If you render now, you should have something similar to my preview above. Remember to keep the grass thick so you don’t see the ground, and don’t use too high of values in the roughness or random amounts.
Now that you know how to use vertex groups and add grass particle systems, try adding the long and tall grass groups to the scene. Create a new particle system and vertex group for each type of grass. The advantage of using multiple particle systems is that it gives you maximum control over exactly where the grass will be laid out, as well as extreme flexibility over the size, rotation, randomness, and all the other particle settings we have covered so far. You can also work one layer at a time – much like using layers in Photoshop, which saves a lot of time.
Place them around the edges and by the bench where the grass is going to be less well kept. To save on memory, hide the particle systems you are not working on in the Modifiers tab. My settings for both groups are below, but try to do it on your own first for learning’s sake.
Tall grass settings:
Once you have all three particle systems in place, your render should look something like this:
Part 5: Adding Materials
The grass looks pretty good now, but we really need to add a better material if we want to make this look realistic.
As you may have noticed while outside, there are three key attributes of grass that are important to remember when making the material. In the image below, you can see that the grass is green, the light passes through it a little giving it a sort of glow, and it has near white highlights.
To copy this, lets go into the material node editor with a grass blade selected and mix together a diffuse (for the green color), a glossy (for the white highlights), and a translucent (for the light passing through) node.
The hardest part is tweaking the diffuse color to fit the scene, but the rest is fairly simple. In figure 5-2, you can see my node settings. Notice the mix factors and roughness values especially. The translucent node I gave a yellowish color but be careful not to make it all the way yellow. (As a general rule, don’t let the little white dot touch the sides.)
Just a note about the glossy roughness value: as a rule of thumb the wetter the grass, the lower the roughness. The more dry and parched the grass is, the higher the roughness. It all depends on the environment.
This looks much better, but it is still not realistic. Grass normally has patches of different colors. For this effect, all you do is add a mix color node, copy the diffuse color with the color picker, and set the other color to a lighter grey/green. Then, use a noise texture with increased contrast to mix the two colors. Lastly, I used the texture coordinate ‘generated’ to make sure the texture will apply over the grass as a whole instead of individual pieces. My node setup is shown below in figure 5-3:
Cool! Now that the grass looks much better the last thing we need to do is make the material for the long and tall grass. As you can see in figure 5-4, I did basically the same thing as above except I lowered the amount of glossy because it was much too powerful on the longer grass. I also did not bother with the textures because these do not fill large areas of space and so they don’t need as much variation. I am using the same material for both the long and tall grass, but you could make them separate – it all depends on the scene.
If you have been following along, your grass should look like this when rendered:
After a tad bit of simple compositing (a topic for a different tutorial), this is the final result:
I hope you guys learned a lot from this tutorial! If you really want to get good at grass, just practice and play around with results.
Thanks for reading!
One or more textures on this 3D model have been created with images from CGTextures.com. These images may not be redistributed by default, please visit www.cgtextures.com for more information.