YafaRay particles with Blender Part 1


 

First of all, simple particles and strands from Blender are not supported in Yafaray yet. So you have to convert your particle system into a consistent mesh which will be than renderable in Yafaray. You can apply an object to particle system, and than you get the "particles" renderable, without converting them to a mesh (because system already use objects in system). The techniqe may be used to creating golf grass, "normal" grass, tropical grass, it's also good to use to carpets, and animal fur.First I'm gonna to show you how to create good looking grass in Yafaray. Second part will be about how to create human hairs, which are a little bit different than grass.

 

Simple grass

 

1. Open Blender and remove all your objects

2. Add new plane which will be a basis for our particle system

3. Go to the Particle buttons and create New particle system

4. In Particle system box change from Emitter to Hair

5. In Physics box set Normal value to 0.1 the same as Random value our particles are more distorted, and looks more like a real grass

6. Change Brown value to 0.05 to randomize our grass even more

 

 

7. In Visualization box you can change Steps value from 2 to 3 (this changes the quality of grass particles, higher = smoother = longer render time)

8. In Editing panel and Modifiers box convert particle system to a mesh

 

 

9. Split 3D view area and choose in  Window Type: Scripts Window

10. Now in Scripts menu choose Mesh -> Edges to Curve


 

Remember, that it will take a while before all edges are converted to curves (from few seconds up to few minutes depending on CPU speed)

11. Now in Editing (F9) panel and Curve and Surface box, mark Back and Front and change Extrude value to 0.01 and DefResoulU to 1


 

12. Press ALT+C in the 3D view and press LMB

 

 

So, now you're done and can put some materials on the grass. These are my settings of simple grass material

 

You should get the same result as on picture below:

 

 

 

 

 

Advanced grass

 

The second method is a little bit harder, but you get better results as well. Now I'm gonna to use an object to be emitted from an emitter as particles, Thanks to this method you can simply map your grass strands to UV texture. Lets start:

 

1. You remove all your objects and add new plane

2. Go to the Particles and Add New system

3. Change in Particle System box type of our particles from Emitter to Hair

4. In Physics box set value of Normal to 0.5 and Random to 0.3 (or if you want you can increase/decrease the value of randomized particles)

 

 

5. Go to the second layer (button 2 on your main keyboard, not the numeric one!) and add new plane. Lets create simple grass strand which will be emitted from your first plane, you can actually use whatever object you want, it can be simple grass strands, it can be flowers or some weed and than you can combine these "particle systems" together to get realistic result

6. Go to edit mode of this plane and scale it along X axis 0.1 times

7. Ctrl+R and rotate mouse wheel until you get 4 cuts (you can just type 4 on numeric keyboard under cutting)

 

8. Mark these 2 vertices on top and choose sharp falloff (O key) and scale them by X axis to zero (you can adjust the affect of modifier on mesh by spinning mouse wheel)

9. Cut your grass strand in the middle (CTRL+R along Y axis) and move marked verices -0.04 along Z axis (remember to set off fall off at this moment)

10. Scale the top of the mesh by Z axis also using falloff, I also scale the object twice along Y axis to have longer grass strands, press N button than you get object properties, in my case the name is Plane.001 so copy the name of the object (CTRL+C) (under time you can set smooth on object so its smoother ;))

11. Rotate the plane 90 degrees clockwise so the sharp top is pointing 3 o'clock. You can add UV texture to your grass strand by from the top view pressing U button and choosing Project From View and in the UV image editor selecting texture you want to use on your mesh and pinning your mesh onto texture with P button

 

 

12. Go to your 1 layer, mark the particle plane and change in Visualization box from Path to Object and paste the name of grass strand (in my case) Plane.001

13. You can make these two layers to make them visible by holding shift and marking first two layers. Mark
(RMB) your grass strand and scale untill you get a result you are expecting (i scaled with 0.1) and move along X axis to adjust particles position on the plane.

14. Your grass is renderable by Yafaray right now, but lets say, that you want to add some modifiers on your grass, so what to do? Lets add some fake
“wind” just to create more realistic behavior of our grass. But first convert your particle system (Editing (F9) -> Modifiers box -> Convert) and join them together CTRL+J. Add new Lattice, scale just over the grass and move over grass

15. Set lattice points of W direction to 10

 

 

16. Now mark your grass and add modifier Lattice and define lattice object name (in my case the name is simply 'Lattice')

17. Mark lattice and go to the edit mode, mark vertices in top of the lattice and move them lets say along x axis with sharp falloff enabled

 

18. You are done now with modeling part it's time to go to the rendering part. Don't forget about camera. Lightning: I used AO with 10 distance and
light blue BG and AO color and sunlamp (yellow of course) angle 2

19. These are my settings of grass material

20. Just press the “RENDER” button and it's done

 

Here is the result I get:

 

Good luck

 

Last very importand thing is that you can use groups instead of simple object mapping. You can add different meshes faster (like different grass types, flowers, weed and stuff like that) and have control over them by adding them into groups (Object (F7) panel and Object and Links panel, you have to change visualization from Object to Group in particle system panel too, and add the name of group you want to add), and finally map them on your ground.

Here is very handful guide about particles in Blender, which can be an addition to this tutorial

http://www.cgcookie.com/articles/painting-instanced-objects-into-your-bl...

 

Here is the link to blend file with UV mapped grass and group mapped particles:

http://www.yafaray.org/sites/default/files/grassadvanced.blend

the video from my workflow will come soon

 

END OF PART 1

AttachmentSize
grasssimple.blend1.77 MB
grass_advanced.blend12.05 MB