In this section we’ll explore two different ways to add vegetation to a scene, using the Fiber brush and ZBrush’s new Fibers material shader.
In this section we’ll bring life to the scene by painting grass. There are actually two ways that this can be done: using the Fiber brush, or by using a Fibers material shader. Each technique has advantages and disadvantages: With the Fiber brush, you can paint fibers exactly where you want them. If you don’t like the effect, you undo, change the settings slightly, and paint again. This can be faster than repeatedly re-rendering the scene to get the exact fibers that you wish. The disadvantage to this technique is that you must usually bake the layer’s lighting before you can get the best results from the brush. This can be gotten around by using a dual-layer system for painting the fibers, which has the added benefit of allowing the fibers to cast shadows on their surroundings (if not on each other). Also, if you are using fibers on a figure, you must re-paint them for every pose of the figure. With the Fibers shader, you are dealing with a render-time effect. This means that there is no need to bake the layer. You can therefore paint fibers at any time; even before you have finalized the scene’s lighting. Also, you can apply a fibers-enabled material to a figure, then repose the figure. The fibers will adapt to the new pose. The disadvantage is that the only control you have over the fibers is through the shader modifiers. This means that fibers can “poke through” other objects that are present within a scene. Also, because fibers are rendered last, they cannot cast shadows on the scene (although they can cast shadows on themselves). It is up to you to determine which approach will work best for your needs. In this tutorial, we will introduce you to both. We’ll begin with the Fiber brush method.
- If it is not already open, load your document from the previous chapter.
- Make sure that the first layer is active, then click Layer:Dup.
This duplicates the current layer, placing the duplicate immediately to the right of the original in the thumbnail list. The new layer will be the active layer.
- Turn off layer 3 by double-clicking on it, then reselect layer 2.
The bamboo will disappear from view. This is one of the reasons why we created the bamboo on a second layer in the first place.
- Click Layer:Bake
What this does is change the layer to the Flat Color material. In the process, all coloring that has been created by the materials and lighting gets converted to unshaded RGB color. You can see the result in the layer thumbnail, which now matches the canvas exactly.
We took this step because the Fiber brush works best with the Flat Color material. In order to resolve any conflicts between the material properties of the fibers and the properties of the background, we convert the background to the same material that the fibers will use.
- Click Layer:Displace Z and set the slider to a value of 1. Press Enter.
This moves the current layer 1 pixol away from the camera. The result is that its surface now lies immediately behind the original background layer. The Flat Color material cannot receive any new shading information, including shadows. If we just painted our fibers onto a baked layer, then we couldn’t change the lighting later, nor would the fibers cast shadows onto the background. However, since the original background layer has not been baked and now rests one pixol in front of the baked layer, we can change the lighting later and it will receive shadows from the fibers that we’re about to paint!
- Turn layer 3 back on, but keep layer 2 as the active layer.
In order to properly place our fibers, we’ll need to see the bamboo.
- Select the Fiber brush from the Tool palette.
- Select the Flat Color material. Then select the grass texture.
The Flat Color material is essential for high quality fibers. The grass texture will be applied to each fiber, resulting in very nice-looking vegetation.
- Select alpha 23
Grass tends to grow in clumps. This alpha will simulate that.
- Set Rgb Intensity to 100.
We don’t want transparent grass.
- Click Document:StoreDepthHistory
This step is a nifty and very useful trick, which borrows a feature embedded in ZBrush by the ProjectionMaster plugin. Ordinarily, every stroke that is painted on the canvas will interact with every stroke that has come before it. In the case of the Fiber brush, fibers would quickly be drawn on top of teach other, resulting in a jumbled mess. By storing the depth history, we’re taking a snapshot of the current depth in the scene. All new depth that is added will be ignored until the depth history is deleted again. In the lower left corner of the scene, paint a few strokes.
Not bad, but the fibers are a bit fine. Press undo a few times to remove them again.
- In the Tool modifiers (which change to match the currently-active tool), set Thickness to 2.
This will make the fibers a little thicker.
- Paint a few strokes again.
This is now very close to what we want. A few more modifications will finalize our settings.
- Set Grooming to 0, and activate Back C.
No grooming tells ZBrush to ignore the direction of your brush strokes. All fibers will be painted solely based on the orientation of the pixols that the fibers are painted on. Back Color active tells ZBrush to blend the background color (which is black by default) with the foreground color (set by the texture). This gives fibers that are a little darker at the base.
- Lastly, set Draw:Depth to 4.
This doubles the length of the fibers that will be painted.
- Draw a few more strokes on the canvas.
Now that you have a brush that paints high quality grass, you might want to save it using Tool:Save As. That way, you won’t need to recreate your settings in the future.
Perfection! This is exactly what the scene calls for, so go ahead and paint grass to your heart’s content. As you work, remember that you can modify the fiber length at any time using Draw:Depth. Also, you will notice that changing the Draw Size also changes the length of the fibers. Again, use Draw:Depth to compensate.
- When finished, save your document as Chapter3-3a.zbr
Next, we’ll redo the grass, this time using the Fibers material shader.
- Click Preferences:Initialize ZBrush
ZBrush will revert to the startup state.
- Open the Chapter3-2 document again.
We’re now back to where we were before we started adding fibers.
- The first thing that we need is a Fibers material. There is already one at the end of the thumbnails, so select it.
- Place the material palette in a tray, so that it stays open while working.
This makes modifying the materials a little easier. The fibers material is actually a shader, which must be in the S1 channel of any material that uses it. Take a look at the modifiers with S1 active. These are “raw” values for the Fibers shader. As you can see from the thumbnail, there’s nothing going on. This is because several key modifiers have not been set.
- Click Material:Load, and select the Fibers05.ZMT material from the ZMaterials folder.
We have provided five fibers materials to get you started in your exploration of this feature. Clicking on any material name will show a preview of the material in the dialogue box. Fibers05 is the closest to grass. When it’s loaded, the material thumbnail immediately updates to reflect the settings.
- On the top shelf, activate M and turn off Zadd.
We want to paint just the material. No color or depth. You might also want to select alpha 8 again.
- Paint the material strategically throughout the scene.
As you work, you will be able to easily see where you’re painting. This is because the Fibers shader works in conjunction with the material’s S2 shader. In short, the S1 channel paints the fibers and the S2 channel paints the background. Since the S2 shader for this material is by default very generic, the base color becomes visible again. At this point, that’s a good thing, because otherwise it would be very hard to tell where we’ve painted anything! Also, you don’t need to worry about the bamboo at all. That lies on a different layer, so might as well not even exist as far as the paint brush is concerned.
- Drag from the Material thumbnail onto some of the original background of our scene, then release.
Like the color patches, the Material thumbnail can be used as a Picker. We have now selected the NoisePattern1 material, which gives our scene its background colors. Notice in the Material modifiers that this material only has one shader channel.
- At the bottom of the modifiers, click the CopySH button.
ZBrush makes it easy to mix materials by providing these copy and paste functions.
- Switch back to the Fibers material, and select the S2 channel.
- At the bottom of the channel, press the PasteSH button.
The preview of the material will change slightly, along with all of the modifiers in this channel. At the same time, the scene itself will update. Everything that was just painted will seem to vanish. By copying the NoisePattern1 settings into this channel, we have created a background that exactly matches the rest of the scene.
- Place the Render palette in the other tray.
- In its settings, activate Fibers.
Since Fibers are a render-time effect, they can be activated or deactivate at will. The ability to turn them off can be very useful at times. It also conserves system resources.
- Activate the Best renderer.
All of the Render palette special effects only become active when a Best render is executed. On the canvas, you’ll see the scene render, and then the fibers will be added.
This looks really great for an autumn scene. What is happening is that the fibers are getting their colors from what is already present on the canvas. Since the canvas is all shades of brown, so are the fibers. There are several ways that we can override this, however.
- Switch back to the Fibers S1 channel.
- Select a grassy green color using the Color thumbnail, then click the Tip swatch in the Material modifiers.
The scene will render again, but won’t appear to be any different. Every time a change is made to the modifiers, the scene will re-render.
- To allow the material to use this new color, we must activate the TipColor blend modifier. Set it to about 50.
When the scene renders again, the green color will blend with the colors from the canvas.
Well, we have green grass, but if you ask me, it’s a bit much. Let’s try the other way to override the color.
- Click on the Texture patch at the bottom of the shader, and choose the grass texture.
- Set ReflectColor blend to .75
This tells ZBrush to blend the texture with the other colors already present in the fibers. Each fiber will now be 25% what it was in the last render, and 75% grass texture.
Here’s the result. Just the right shade!
Now that the color is perfect, it’s time to tweak the rest of the modifiers so that we have tufts of grass rather than a bunch of bushes.
- Set Density to 10
- Set Length variations to 25
- Set Density variations to 25
- Set Direction variations to 35
- Set SelfShadows to 25
- Set DarkenEdge to .25
- Set Strand Width to 3
A Best render now should give results like what you see in the picture below:
- Save your document as Chapter3-3b
You will be able to compare the two versions and use the one you like best for the next section.
In this chapter, we have explored two unique ways to add fibers of all kinds to a scene. The Fiber brush is a power 2.5D paint tool that adds fibers to the canvas as pixols that can then be modified later in your work. The Fibers material shader adds the fibers as a post-render effect. A variety of modifiers are available for either approach, which can be used to create anything from grass to hair to waterfalls.