Tutorial : realistic grass with Yafaray

This tutorial will teach how to model a realistic grass with Blender and to render it with Yafaray. It’s based upon several tutorial (including http://www.yafaray.org/documentation/tutorials/particles1 and http://blenderartists.org/forum/showthread.php?t=68269) so I won’t claim I discover it by myself. It’s just a handy mix to achieve a good result with very few effort.

yafaray-2009-07-27_230619

Grass is only a small part of the above picture, but having it realistic add a lot of credibility to the whole picture. I started to work on grass for my current project, a C5 DTM Coupé concept for the SMCars.net contest “Real World Racer”. I wanted to add a good scene, something I didn’t do for the previous project, the Marcos 1800 GT. And what more intuitive than a race track for a race car ?

Modeling the grass

Blender has a very nice feature, particles system. There is even a particles system dedicated to hair, fur or grass. It’s really easy to use, and especially easy to tweak to make the grass high, low, dense, sparse, aligned or disturbed. Please follow steps 1 to 12 in the first link above : http://www.yafaray.org/documentation/tutorials/particles1. I just used different settings to match my need :

  • I use about 3000 particles per square meter. That is, 3000 grass pieces. When you create your emitter, just compute its area and set the particles count to follow this rule of thumb.
  • I used the following physics setting : for initial velocity, 0.008 as normal and 0.005 as random, and for global effects, AccZ of -0.001.

Once we converted the particles system to mesh then to curves then back to a mesh but with thickness this time, I copy the original particles emitter object to a hidden layer, making future changes easy. I said “I copy” because I need to keep the emitter surface as a ground below the grass. For this object, just turn off particles, a simple surface will do the job.

You now have 2 mesh objects : a dense one, for the grass pieces, and a light one, the ground below the grass. We now need to quickly create 2 shaders to see the result : just a green and a brown one will be enough for now :

brown shader green shader

Rendering it with a simple lighting (DirectLighting with SunSky background, no sun) will give you the following :

yafaray-2009-07-26_175759

It’s a bit too simple as of now, but the modeling is done.

Rendering a realistic grass

Turn the previous simplistic render into a realistic one is easy. We just need to add a grass texture to create color variation on the grass.

I used the one provided in the second tutorial I linked at the top of this article : http://blenderartists.org/forum/showthread.php?t=68269. Here’s that texture :

It’s a basic texture set : just add an Image texture to the previous Green shader, select the image file and voilà ! No other setting need to be tweaked.

It’s time to render again :

yafaray-2009-07-26_180621

Except for a gap between ground and grass, we’re done. For the real use I showed in first picture of this article, the work is exactly the same. I just took care to measure the surface of my emitter mesh to achieve a proper grass density.

You can now play with particles settings, and texture, to get a different looking grass. Show your own below in comments !

Leave a Reply

Your email address will not be published. Required fields are marked *