Blender includes a powerful particle-generation system. Particles enable you to simulate the behavior of large collections of small objects. Dust clouds, falling snow, spilled beans, and other such granular phenomena can be handled well using dynamic particles with Newtonian physics. Blender also includes boids simulation for emulating the behavior of large collections of living organisms such as bird flocks, insect swarms, and fish schools. Finally, particles are the basis of Blender’s hair-simulation functionality.
In this chapter, you will learn to
In CG, the behavior of very small things acting in groups is animated differently from the way ordinary-sized objects are animated. Many programs, including Blender, deal with these kinds of effects by using particles. As you can imagine, effects such as smoke, dust, or granules of some substance are often best handled with particles, but as you will see in this chapter, the potential of particles extends beyond these uses. Whether something is “very small” depends on the perspective you want to take in the animation. A bird, for example, is clearly big enough to warrant being animated in a traditional way in certain cases. A flock of birds, on the other hand, behaves in a way that may be better simulated by using a particle system, as demonstrated later in this chapter.
Blender’s particle functionality enables you to define groups of particles called particle systems by setting how they animate and render. You can create multiple particle systems with different parameters and have them interact in a variety of ways. There are two fundamentally different ways in which particles are usually used. The particles used for simulating tiny moving objects such as dust, raindrops, insects, or the like are called dynamic particles. In Blender 2.6, dynamic particles are emitted from a Mesh object, so they are referred to as emitter particles. (Users of pre-2.5 Blender particles will remember reactor particles as another type of dynamic particles. Unfortunately, reactor particles remain on the to-do list of features that have not yet been re-integrated into the updated Blender versions.) The other use of particles is to simulate long, slender objects such as hair or grass that are anchored to a surface. In Blender, these types of particles are called hair particles.
Particle systems can be added to mesh objects in the Particles area of the Properties window by clicking the plus symbol to the right of the field shown in . Only a Mesh object can act as a particle emitter. If you have any other object type, or no object selected, you will not be able to add a particle system.
The Particle System properties panel tab shown in enables you to select which particle system you are working with and add and delete particle systems. The Settings drop-down menu enables you to select the particle system datablock to be associated with the current particle system index or add a new system to the particle system index. You can select between Emitter and Hair particle types in the Type drop-down menu and set the rest of the values for the particle system in the other tabs on this panel.
When you create a particle system, the first thing to decide is what type of particle system it is. The options here are Emitter (the default value) and Hair. (Reactor type particles have been discontinued since Blender version 2.5 but are slated to be brought back in a future release.)
Emitter particles are particles that emit from the Mesh object that they are associated with (known as the emitter). Their emission is controlled directly by the various parameters set in the particle system.
The settings in the Particle System properties area determine the general characteristics of how the particle system behaves. As you change settings, returning to frame 0 will reset the particle system so you can view your modification.
The Emission settings include the following:
All of these values taken together influence the density of the particles. The density of the particle system often plays an important part in creating a convincing effect, so it is important to be aware of this. For example, if you increase the number of frames that your particle system is active for without changing the Amount value, the resulting particle output will be sparser.
The Emit From button values—Faces, Verts, and Volume—determine how the particles emit from their emitter mesh. The buttons enable you to select where on the mesh the particles emit from.
The Random check box controls whether particles are released from the mesh in a set order or whether the ordering is randomized. For example, if 800 particles are set to be emitted from a cube’s vertices, 100 particles will be released from each of the cube’s 8 vertices, in a fixed order, if Random is unchecked.
The Even Distribution check box sets the emission of the particles to be calculated based on the size of faces and the lengths of edges in order to yield a more uniform distribution.
Distribution choices are Jittered, Random, and Grid. These enable you to choose how the particles are arranged with respect to the surface they are emitting from.
In the example shown in , emitter particles are set to emit from an Icosphere mesh. This figure shows particles with all default values in place. If you add a particle system to an Icosphere and press Alt+A to play the animation, this is what you will see. Notice that the particles are being affected by gravity. This is due to the fact that Newtonian physics is set on the particle system by default, that the Gravity value is 1 under the particle system’s Field Weights tab, and that the gravity of the scene is set to -9.810 along the z-axis.
Gravity is a scene property, so it is set in the Scene properties area, as shown in .
You can see an example of particles positioned inside a Sphere mesh in , where the particles are visualized as 3D axes.
The Invert option below the drop-down menu reverses which points on the grid have particles; as shown in , the bounding box’s negative space is filled with particles and the shape of the mesh is empty.
If Faces is selected from the Emit From drop-down menu, with a Grid distribution, then the grid particles will conform to the shape of the mesh shell of the object rather than to the shape of the object. With the Invert option, the empty space inside the mesh will also be filled with particles. This is a way to make particles take a specific shape.
It is possible to store the calculations for the particle simulation, so that the animation can be sped up in subsequent viewings. To do this access the Cache tab in the Particle properties area. To bake the simulation, simply enter the start and end frame values for the time segment you want to bake and click the Bake button. Once baked, the basic particle properties for the system will no longer be editable. If you want to adjust these properties, you will need to click the Free Bake button that replaces the Bake button on the same tab.
The Physics tab contains the fields that most directly influence the way the particles interact with the forces in the world. There are five options in the Physics drop-down menu: No, Newtonian, Keyed, Boids, and Fluid.
Newtonian physics is the default physics option for particles. With Newtonian physics selected, the particles are subject to gravity, acceleration, and force fields defined on other objects. Newtonian physics enables particles to interact with deflection objects and is also necessary in order to use soft body simulations on a particle system. Most of the cases described in this chapter and in Chapter 4, “Rendering and Render Engines,” use Newtonian physics.
With Newtonian physics selected, you can set the physics parameters in the panel shown in .
You can also determine the initial velocity and rotation of the particles in the Rotation and Velocity panels, shown in .
The Velocity panel enables you to set the direction that the particles are initially emitted in. The possible directions include the following:
The Rotation panel is where you can set the angle and degree of rotation of individual particles and set the angular velocity in the Angular Velocity drop-down menu, with the default value of Spin shown. This menu enables you to select characteristics for the angular velocity of individual particles. The options are Spin, Random, and Velocity.
Additionally, the Newtonian physics options enable you to set the mass of individual particles, their size, and the amount of randomness in the size of particles, as well as values for Brownian, Drag, and Damp forces, which affect the way the particles respond to external forces.
Keyed physics makes the movement of one particle system dependent on the movement of another particle system. A particle system with keyed physics needs at least one target object and particle system defined to determine its motion. In , a particle system on Object 1 is keyed to the Newtonian particle systems on Objects 2 and 3. As you can see, the ordering of the Keys list determines where the keyed particles originate from and the path of their flow. It is possible for the target system to also be a keyed system. However, a non-keyed target system is necessary at some point to initiate the motion of the keyed systems.
Fluid physics mimics the properties of fluid dynamic systems. In practice, this is often similar in appearance to the Newtonian option, but it can give more subtle and realistic results in cases where the particles are intended to represent fluid, such as splashing water, or have fluid-like properties, such as pouring sand.
As you’ve seen already in previous examples, there are various options for visualizing particles, both in the 3D view and in the final render. Some of the visualization options are useful mainly as ways to visually distinguish separate particle systems when more than one are active. Other options enable extended functionality and require further parameters to be set.
Visualizations in the Blender 3D viewport are managed in the Display tab. The Display properties determine what information about the particles is shown in the 3D view, including information about velocity, size, and number. There are also fields to input the size of the particle visualization in the 3D viewport and the percentage of the total number of actual particles that will be displayed in the 3D viewport. Setting the Disp value to less than 100 may make it easier to work with large particle systems that require large amounts of RAM. The options available in the Display tab are as follows:
Render options are managed in the Render tab. The options available in the Render tab are as follows:
Particles are rendered according to the material index of the emitter object, which is set on the Render tab. You can also determine here whether the emitter itself will be rendered, whether parent particles will be rendered, whether unborn particles will be rendered, and whether particles will be rendered after they have died, all by toggling the corresponding buttons in this area.
Objects can influence the behavior of particle systems in two main ways, by using force fields and deflection, which can be found in their respectively named tabs in the Physics buttons area.
Many natural forces, from wind to magnetism, can be made to act on particle systems by using force fields. Force fields can be activated on any objects or added to the 3D scene directly through the Shift+A Add menu, which is essentially equivalent to adding an Empty object with a force field active on it. In order for a force field to act on a particle system, the force field object must be on the same layer as the object with the particle system and within the group designated in the Effector Group field in the Field Weights panel of the particle system, shown in , if an effector group has been specified. In the same panel, you can set the degree to which various types of forces (including Gravity, which is not a force field in fact, but a scene property) act on the particle system. In the Force Field Settings tab, also shown in , you can set various force properties of the particle system itself, for example, a positive or negative electrical charge, which can interact with external forces.
The Add Force Field menu is shown in . The following 12 types of force fields are available:
Although any single object can have only one force field active on it, it is possible for multiple force field objects to operate on a single particle system at the same time. Force parameters are keyable, so you can control the strength of the force with an F-Curve in the same way you would control other keyable values. This enables you to create effects such as gusty winds or to change the direction of a vortex force.
Particles can be made to bounce off an object rather than penetrate it by activating Collision properties in the Physics properties area of the object. The particle-related Collision properties are as follows:
Force fields and collision objects also interact with soft bodies similarly to the way they interact with particles. You can read more about using force fields and deflection with soft bodies in Chapter 5, “Getting Flexible with Soft Bodies and Cloth.”
Particles can serve as the basis for breaking solid objects apart, using the Explode modifier. You can see a simple example of this by following these steps to make a sphere burst apart into jagged pieces.
Another option for the physics of particles is Boids. Boids are used to represent the movement of swarms of insects, schools of fish, flocks of birds, and other animals moving in groups. All have similar patterns of behavior that can be mimicked by using a fixed set of criteria to determine the direction and speed of each entity’s movements at each point in time.
In the Physics properties for boids, you can control the maximum and minimum air speed for the boids, the maximum and minimum acceleration values, the average amount of personal space each boid gets, all for both flying and land travel cases, as well as the smoothness of landing, in cases where boids both fly and travel on land.
By default, boids behavior occurs in 3D, as in the case of birds, fish, and flying insects. To simulate ants or other swarmlike behaviors that occur over a surface, you can select the Allow Land option.
In a boids system in Blender 2.6, there are two general rules that can be prioritized on the Boid Brain tab. These are Separate and Flock, which determine the boids’ overall desire to move away from each other and their overall desire to stay close to one another.
Setting up a basic boids system is simple. As with other particle systems, it is necessary to create an emitter (boids themselves can be of either Emitter or Reactor particle types). Set the Emit From value to Random and choose Boids from the drop-down menu on the Physics tab. That is all there is to it to create a simple swarm of particles.
As you can see if you press Alt+A with this setup, the boids emanate outward from the emitter object in indirect, wiggly trajectories. At each step, their velocity is recalculated to enable the boids to continue their current course, subject to the default constraints. Because the Crowd constraint makes it a priority for the boids to avoid colliding with each other, and there are no goals, predators, or deflection objects to influence their trajectories, they tend to move farther and farther away from each other.
Goals and predators are created by placing an object on the same layer as the boids system with a Spherical force field. A negative value in the force field means the object is a goal, and a positive value in the force field means the object is a predator. When a goal force is present, the boids head straight toward the goal after being emitted from the emitter mesh. After they reach the goal, they circle back and pass through it again and again as long as they continue to be alive. When a predator is set up, the boids make a wide arc around the predator object and circle back to meet the goal object.
Predators and goal objects can be moved and animated, and the boids respond in real time, making their way around one side and then the other as the predator passes. Both predators and goals can be animated, resulting in the expected boids’ behavior. If you’ve ever been chased by a swarm of bees, you already know something about how boids behave when pursuing a moving goal.
Boids can be put to many uses, but because they are fundamentally intended to mimic the behavior of living creatures, one of the primary uses for them is to animate actual animals. In the next section, you’ll see how to make a simple bird model that can be easily used with a boids simulation to create a convincing flock of birds.
An ideal example of the use of a boids system is a flock of birds. To create this effect, it’s necessary to start by setting up the object that will exhibit the boids’ behavior. To set up a simple flying bird, follow these steps:
After you have finished the model, you can use it as a Render object for a boids system, as shown in . Add predators and goals to make the birds move in an interesting way. For details about this example, you can refer to the blend file among the downloadable files on the book’s website.
As you can see, there are many possibilities for how to use dynamic particles. You can combine the methods described in this chapter in virtually unlimited ways.
Hair and fur are an important use of particle systems. Obviously, there are big differences in the behavior of hair from the behavior of dynamic particles, but there are also a lot of similarities. This section walks you through the process of setting up a basic hair particle system on a sphere, in order to show you examples of some basic concepts in action. In the next section, you’ll learn more about rendering hair particles efficiently and the features available that enable you to get good-looking hair rendered fast enough to be useful for animation.
Setting up a hair particle system is simple. You just add a particle system to an object and choose Hair from the Type drop-down menu. The result is shown in , on the default cube with default hair particle values.
Clearly, this isn't quite the effect you’re after. Fortunately, there are a lot of things you can do to get convincing-looking hair that will render realistically. In the next section, you’ll look more closely at the practical tools available to make your hair look great.
In this section, you’ll see how to use Blender’s particle tools to get the hair and fur effects you want.
To follow the steps in this section, you’ll want a good mesh character head to work with. The model mannequin.blend, shown in , can be found on the website for this book. Of course, you can work with a model of your own instead.
For best results when working with hair in Blender, it’s helpful to plan things in advance and to decide how you want the hair to emit from and interact with the mesh. In this example, I’m emitting hair directly from the model mesh. Specifically, the new particle system is much better equipped to be deflected by the emitter mesh, making it possible to work with long hair that interacts with the head, neck, and shoulders.
The geometry of the mesh has an effect on where the particles emerge from and on how weight painting and seams can be applied. Therefore, it’s a good idea to organize your model’s geometry to make the hairstyling job easier where possible. I planned the geometry of this model deliberately to give me an easy-to-work-with hairline, as shown in .
The last thing to do to prepare the mesh is to decide where you want your particles to emerge from and to set up an appropriately weighted vertex group. I created a vertex group called Hair and assigned the scalp vertices to that vertex group with a value of 1. In Weight Paint mode, the weighted mesh looks like . As you’ll see, it is possible to add hair and to cut hair from the mesh later, as part of the particle-editing process, but using a vertex group is a simple and straightforward way to map out in advance where the hair will grow.
Before you start styling, you need to give the model some hair to style. Do this by activating a Hair particle system with the values set as in . Keep the default particle count (Number) of 1000. Set the Hair Length value to 0.5. On the Vertex Groups tab, enter Hair in the Density field. This sets the hair density according to the weights of that vertex group, which as you saw were 1 for the scalp and 0 for the rest of the head. In this area, you can also set other values such as length to be controlled by separate vertex groups. For this example, we will use a vertex group to control only density.
A thousand hairs aren’t nearly enough hairs to cover a human head, so it’s necessary to add some thickness by using child particles. On the Children tab, set the child particles to Interpolated, as shown in . Set the Display value to 100 and Render to 250 (or a bit more, if you find that your RAM can handle rendering more). The clumping and the roughness values are completely arbitrary. Set these to a low value or leave them at zero for the time being and come back to them later. Because child particles themselves are not cached, you can change the values on the Children tab freely at any time, even after the hairstyle has been edited. Plan to experiment with these values a bit later.
Once you start editing the hairstyle, you will not be able to change many of the basic particle system values. Basic (parent) particle count, Emit From, and other values are all inaccessible. If for any reason you want to go back and change these values, you will need to click Free Edit, located in the top panel of the Particle properties area. Doing so will discard all the changes you made in Particle mode. There will of course be times when you will want to do this, but it is important to bear in mind that the main particle values should be set as you want them before you put a lot of effort into hairstyling.
After you have set the particles to be editable, enter Particle mode by selecting it from the Object Mode drop-down menu in the 3D viewport header, as shown in . Particle mode is specifically for use in editing the behavior of hair particles. In Particle mode, you can control the behavior of particles directly by using paintbrush-style tools somewhat analogous to the sculpting tools described in Chapter 2, “Working with Textures and Materials.”
Like the Sculpt tools, the hairstyling tools are designed to work directly on the particles in real time, and so the input device you use can make a big difference in how comfortable they are to use. Although you can do hairstyling just fine with a mouse or even a laptop touchpad, I highly recommend some form of a pen tablet if you plan to do a lot of this kind of work. An integrated tablet monitor is especially nice to work with, enabling very direct interaction with the particles and a much more ergonomic working position than is typical with a mouse. Such devices aren’t particularly cheap, but then again, they are considerably less expensive than most major 3D software applications with functionality comparable to Blender. Another advantage of using open-source software is the way it frees up your hardware budget!
In Particle mode, the various tools are accessed via the Particle Edit tool shelf, which is toggled on and off by pressing the T key. Press the T key now to toggle the panel into view. It should look as shown in .
By default, the None edit option is selected, which does nothing. The other edit options are as follows:
For all the tools, you can easily resize the brush while you work by pressing the F key and adjusting the size of the circle with your mouse, and then pressing the left mouse button to set the new size. Brush strength is adjusted by pressing Shift+F. You can also quickly change between tool types by pressing Ctrl+Tab in the 3D viewport and picking the tool you want from the pop-up menu that appears.
Other options in the Particle Edit tool shelf include Keep Lengths, which ensures that the hair length does not change when the hair is combed, and Keep Root, which simply ensures that the root of the hairs remains anchored to the emitter. If this is unselected, your model will suffer massive hair loss when the hair is combed, as shown in . You would use this option if you wanted to make something out of hair that was not connected to an emitter mesh.
The Draw Path Steps value determines the accuracy with which the hair paths are displayed in the 3D view. More steps equal greater accuracy at the expense of display speed. The Deflect Emitter option enables the emitter mesh itself to deflect hair. This is important to have activated, because it prevents hair from just being combed right into the head. With a Deflect Emitter value of about 0.25, the hair tends to behave in a natural way and avoid penetrating the head. Sometimes stray hairs will penetrate the mesh and become stuck, so that the hair will not respond properly to combing. If this happens, temporarily disable the Deflect Emitter option and use the styling tools to fish the stray hair out of the mesh. The Children check box toggles the display of child particles on and off. Seeing the child particles’ location and behavior is helpful while styling, but because displaying child particles can slow down the display and sometimes interfere visually with the styling work, you will toggle this on and off a lot as you work.
There are three main selection modes in Particle mode, and you can switch from one to another by using the three header buttons: . The selection modes within Particle mode are called Path Edit mode, Point Select mode, and Tip Select mode. In Path Edit mode, hairs are displayed as shown in . You can use the tools directly on the hair paths, and they will respond as you expect. It is not possible to select individual hairs in this mode; however, hairs that have been selected in other modes will be displayed white in this mode. You can select all hairs by pressing the A key. The main purpose for Path Edit mode is to provide a relatively uncluttered view of the hair. The other modes enable greater control by enabling you to select individual hairs and portions of hairs.
Point Select mode is shown in . When you are in this mode, you can select individual points on the hair in a way that is analogous to how you would select vertices on a mesh. In the figure, the orange points were selected by using the B key (Box Select tool). The C key circle selection method can also be used in Point Select mode. To select full hairs in this mode rather than just points, you can use the L key. It is possible to select multiple individual hairs by holding down L while moving your mouse over the points of the hairs. Note, however, that the L key selection method requires that the mouse pointer itself touch the hair points. It is not the same as Circle Select mode.
After you have selected the points you want to select, you can rotate, scale, and translate selected points similarly to the way you would with vertices in a mesh, by using the R key, S key, and G key, respectively. The active hair-editing tool will work only on the selected points. In this way, you can comb, cut, lengthen, or otherwise edit specific hairs without affecting other hairs. By pressing the H key, you can hide selected hairs. Hidden hairs do not disappear but rather are displayed as white. They are invisible to the edit tool, however, so you can use the hide function to mask off portions of the hair while editing others. You can also use Proportional Editing tools when editing hair, just as you would when editing a mesh.
Tip Select mode, shown in , enables you to work with the tips of the hair only. In the figure, the tips displayed as orange were selected by using the Box Select tool. When you comb the hair in this mode, the effect of the combing is diminished along the length of the hair toward the root. This enables you to fine-tune the ends of the hair without disrupting the overall shape of the strand.
By default, the Limit Selection To Visible option is selected. If you toggle this off, you will be able to see and select hairs that would otherwise be concealed behind the mesh.
The W key opens up the Specials menu, as it does in Edit mode. The Specials menu in Particle mode enables you to choose to rekey selected hairs and to remove doubles. Rekeying hairs means to change the number of key segments that compose the hair. If you need more (or fewer) key points to work with, you should rekey the hair. Removing doubles is analogous to the similarly named function in Edit mode. It removes unnecessarily duplicated hairs. If you are in Point Select mode, there are three other options in the Specials menu: Select Roots, which lets you select all the root points of the hairs; Select Tips, which lets you select all the tips; and Subdivide, which adds extra key points in selected segments, analogously to the similarly named function for meshes and curves.
After you have your hair set to be editable and have entered Particle Edit mode, you can begin to get down to the business of styling your model’s hair. To start with, the model’s hair is sticking out straight away from the head, if your settings are as I described them previously. Be sure that Keep Length and Keep Root are selected and also that Deflect Emitter is selected.
Begin by combing the hair into a general shape. This is just an overall motion for all the hair, so set the view to wireframe by pressing the Z key so that the comb affects hairs on both sides of the mesh. View the model directly from the side by pressing the 3 keypad key, and make sure you are toggled into orthogonal view with the 5 keypad key. Because this is just general styling, go ahead and set your comb tool to full strength. You can get an idea of the motion of the strokes you should be using in .
Switch to front view by pressing the 1 key on the keypad. If you haven’t already entered Point Select mode, do so now. Using the Box Select tool (B key), select all the points on the left side of the model’s head, as shown in .
Switch back to side view with the 3 keypad key and comb the hair on the left side of the head behind the ear. Now that you’re working on more-detailed styling, you might find it easier to work if you reduce the strength of the Comb tool. At a lower strength, you will need to use more strokes to get the hair in the position you want it in, but it is easier to make subtle adjustments without upsetting other parts of the hair. Of course, adjust the size of the brush as necessary, by using the F key. Probably you will want the brush smaller for finer details than it was for the general combing. You will need to toggle Show Children on in order to make sure that child particles are not penetrating the ear. However, combing and selecting are easier to do without the child particles shown, so I find that I toggle this on and off fairly regularly. If you have the hair mostly as you want it but still find that a few stray children are penetrating the ear, try to narrow down which parent is responsible for those children and press the L key to select that parent strand only and comb it away from the ear. Remember that you can even select individual points and move them where you want them by pressing the G key if necessary.
Now move the model around and view it from some different angles, combing the hair along the outline of the model to smooth it down, as shown in . One useful way to ensure that the hair is behaving itself from all angles is to rotate the model incrementally by using the number pad keys 4 and 6. To do this, start in front view by pressing 1. Comb the hair into a pleasing shape from this angle, as shown in ; then press 6 to rotate the model slightly. Comb the hair smooth along the outline of the model, and then press 6 again to rotate the model further. At each stage of the rotation, comb the hair smooth along the outline of the model. For the other side of the head, do the same thing, but rotate in the opposite direction by pressing the 4 key.
At this point, the hair probably conforms pretty well to the shape of the head. However, this is only natural if the hair is wet or pulled tightly into a pony tail or bun of some kind. For more naturally flowing hair, there should be a little bit of body in the form of some space between the hairs as they lie on the head. To add this body, use the Puff tool. Like the Comb tool, the Puff tool is easiest to use by moving it along the edge of the model as shown in the viewport, so you can see the effect directly and control the direction of the effect. As you draw the tool along the curve of the scalp, the hair puffs up and rises away from the scalp, as shown in . In most cases, simply puffing up the hair will not result in a very shapely hairstyle. You will want to go over this again with the Comb tool set at a lower strength (and probably a smaller size) to give this puffed-up hair a cleaner outline. If you want to clean up the tips of the hair only, comb it again in Tip Select mode so the roots stay puffed up and the tips respond to the comb.
There are several other important hair-editing features that you will often use. The Length tool adds length to or subtracts length from the hairs it touches. As with the other tools, I find it’s easiest to use the Length tool by working along the contours of the model. The Cut tool works exactly as you would expect. Its effect is shown in .
Following the steps I just described (aside from the Cut tool), I arrived at the hairstyle shown in . Yours won’t look like this when you render it yet, though. You need to set up the material and texture for the hair correctly first, which you’ll look at in the next section.
The secret to convincing hair materials lies in the textures. In particular, using a strand-mapped ramp texture for the alpha gives a convincing fade for the ends of hair and the base of the hair where it meets the scalp. Of course, real hair doesn’t fade or become transparent at the tips, but real hair is finer than the simulated particle hair, and different lengths make the hair appear wispier at the end. Alpha transparency mimics the wispiness of hair around the edges.
The basic hair material properties are shown in . The material is called HairMat, and it is the second material in the stack for the object (the first material, Material, is the material used on the head mesh). This means that HairMat is material index 2.
Note that Z Transparency is on, and Alpha is set to zero. This is important, because the hair will get its alpha values as well as its color from textures.
The material must be associated with the hair particles in the Render panel of the Particles properties area, by entering 2 in the Material field, as shown in .
Textures will be strand mapped to the hair. Strand mapping is an important method of mapping textures to hair. As an illustration of the difference between strand mapping and the default generated coordinates mapping, I’ve used the Colorband texture in to show clearly how the different mappings affect the way textures show up on hair strands in . The image on the left is strand mapped, so the colorband runs along the length of each strand. The image in the middle is Orco mapped, so the strands take their color from their point of origin on the emitter mesh. The image on the right shows how the mesh looks with the colorful hair material applied to it also. As you can see, the color of the mesh at the base of each strand determines the color of the emitted hair.
The alpha texture is shown in . The white in the color ramp fades abruptly on the left, softening the point of contact between the hair root and the scalp. The fade on the right is gradual, representing the wispiness of hair ends. Note that the Mapping Coordinates are set to Strand/Particle and only Alpha is checked on the Influence panel.
The color texture is shown in . The color ramp represents the hair color from root to tip; in this example I made the roots a darker brown than the rest of the hair. Like the alpha texture, this texture is strand mapped. The Influence for this texture is Color.
That’s all there is to texturing hair. Similar settings to this will work for a variety of different hair types.
When you’ve finished these steps, you’ll have a reasonably convincing ball of hair you can start experimenting with. You’ll notice right off the bat that the hair you’ve made so far is much too perfect. No animal or human hair is as unmussed and uniform as this. You can fix this by adjusting values in the Children tab.
A very useful parameter is the Clump value, which determines the degree to which the hairs cluster together in bunches around the parent hairs. Natural hair almost always clumps slightly, so adding a small clumping value often gives a more-realistic effect. A positive value makes the tips of the hairs meet, whereas a negative clumping value causes the roots to be bunched to close together and the tips to spread. The Shape value for clumping is analogous to the shape value for the particle strands themselves; a positive value causes the clumps’ shape to be convex, bending outward, and a negative value causes the clumps’ shape to be concave.
Roughness adds a random variation to the straightness of hair. The Rough1 value on the Children tab creates a location-dependent roughness. This means that the kinks of each hair will be similar to the kinks of that hair’s neighbors. This is good for naturally kinky hair, as shown in . Rough2 is random roughness, which affects each hair individually. For this value, you can set a threshold so that the roughness affects only a percentage of the hairs. This roughness creates a more-haphazard, disheveled look. The purpose of this rough value is to add realism by giving a little bit of looseness to an otherwise well-put-together hairstyle. It should usually be used with a very low percentage value. The RoughE value adds an uneven component to the edge of the hair, with the Shape value affecting the shape of the resulting jagged edges of the hair.
Selecting the Kink button displays a panel with a drop-down menu that has the default value of Nothing. Each drop-down option results in a different effect on the hair. All effects can be adjusted in terms of their Frequency along the strand, their Shape, and their Amplitude, or the amount of displacement from the strand’s base path. The options in this drop-down menu are as follows:
By using these effects in combination with the styling techniques discussed later in this chapter, you can create a wide variety of realistic hairstyles.
Some examples are shown in .
In general, most of the same principles apply to lighting particles as to lighting other things. Three-point lighting is effective if used sparingly. Shadows can be an important component to hair—it will be noticeable if an unshaded mesh can be seen under hair—so care should be taken that shadows are dealt with where necessary. This does not necessarily mean that ray tracing should be used. In fact, if you’ve tried to render any of the examples you’ve seen so far in this chapter, you should already have a sense of some of the issues with rendering hair. There is potentially a lot of geometry there for a ray tracer to navigate. Fortunately, several new features enable scenes containing hair to be rendered more efficiently. It’s notable that almost no ray tracing was used in the rendering of Big Buck Bunny, with the exception of a few shots in which flowing water figured heavily. This should be considered strong evidence for the kind of high-quality images that can be produced without resorting to ray tracing.
One new development that helps to make it possible to render large numbers of strands is the Strand render option on the Visualization tab for hair particles. With Strand render, the polygons that make up the hair are created on the fly based on the strand’s key points. Using Strand render is highly recommended for rendering large amounts of hair, because it is fast and memory efficient. However, when Strand rendering is used, ray tracing is not possible on the strands themselves. Instead, you can use buffered shadows. To use buffered shadows, make sure that your lights are of the Spot type and select Buffer Shadow on the Shadow tab of the Edit buttons area. On the Shader tab of the hair material, set Translucency to an above-zero value to enable backlighting to shine through the hair.
Activating Child Simplification with the check box shown in will automatically remove child particles from portions of the scene that are distant from the camera. The Reference Size value refers to the true size of the object. When the object becomes smaller on the screen than this size (in pixels), child particles begin to be removed. The Rate value determines how quickly they disappear, and the Transition value determines how gradually individual child strands disappear, whether they blink out or fade out gradually. Selecting Viewport also removes strands that fall outside the borders of the viewport. The Simplification options can greatly speed up your renders and in some cases make renders with a high strand count possible that wouldn’t be otherwise.
There are several other new features that give you more options for lighting particles. The Surface Diffuse option incorporates the mesh surface normals into the calculation of the strand normals, leading to more-uniform shading. This can simplify lighting, because the particles will tend to respond to light less like many individual objects and more like a consistent single surface. It also can create a pleasing, somewhat impressionistic lighting effect.
Ambient occlusion (AO) is an attractive lighting effect when used appropriately, and as most users of Blender know, different situations will get better results from either raytraced AO or approximate AO. Approximate AO is likely to be your best option for ambient occlusion.