|
Scanline particles are ideally suited to small and thin objects such as hairs. The following tutorial demonstrates a typical workflow for creating hair: Tutorial level: Advanced Example project: 'tutorprojects/rendering/hairs' 1. Load in the object 'models/nurbs/simple head' (or model the head yourself). ![]() |
![]() |
2. We start by texturing the hairy area of the head with a material that looks like hairs. This helps to keep the amount of real hairs reasonably low. Select the loaded head object. Go to the Materials tab of the toolbar and activate the UVimage tool. Define a suitable file name for storing the image, set color to black and press Accept.
3. Turn shaded OpenGL drawing on from the compass menu. Because of the attached black uvimage, the head appears black. Paint the area, which should be covered with hair, using the 3D painting tools (included in the Materials tool tab). Use the tools as follows:
The paint color should be white. The image will be used later as a scope map, and white means fully hairy material.
|
![]() |
4. After painting, select the head, open the property window and go to the Col tab. Clear the Texture field, which contains the name of the painted image, and hit Enter. Set the Surface Properties/Color gadget to a suitable skin color (e.g. light brown 1 0.8 0.7).
5. Next we define the materials for the hairy skin. Three materials are needed for this purpose:
|
Change the select window to show the material library. Select twice New/VSL Material and once New/Level Material from the select window's popup menu. 6. Select the first created VSL material. Rename it as hairbase. Enable Advanced options of the property window and add the following VSL objects to it:
|
![]() |
|
7. Select the second blank VSL material. Rename it as HairArea. Add a Surface properties shader and a Texture object to it. Set the output channel of the Texture object to Surface:Scope and input to Surface:UV coords. Set the File name gadget to the name of the image, which was initialized in the step 2 above and painted later. Other options are shown in the example image. |
![]() |
![]() |
|
10. Now we can start adding the actual hairs. Switch to the Geometric Objects tab of the Select window and select the original head object (not the level containing it). Go to the Wire tab of the property window and set Texture Quality to for example 128. Wait for a while until the HairBase texture pattern appears to the view window. Seeing the hairy area, which was already 3d painted to the head, will guide us where to add the hairs.
|
11. Zoom in so that the head fills most of the view. Activate the Particle tool from the Creation tab of the toolbar. Select airbrush painting, 2D particles, Line Width = 50, Count = 30 and Projection = Surface from the tool control bar. |
![]() |
|
12. Start painting the hair over the head by dragging with the left mouse button over the hairy areas. Rotate the view occasionally so that all areas get painted. Do not worry if hairs are added to the wrong place such as the nose - they can be removed later. On the contrary, brush a fair amount of hairs over the boundary of the hairy area, so that the boundary will have enough hairs. Click Accept when the hair is reasonably dense everywhere. A suitable amount of hairs is 5000 -10 000. Using a very high amount can make screen refreshing slow and cause memory problems later in ray trace rendering. If this happens, it is good to know that using a high box count in box rendering decreases the memory requirements. You can check the amount of hairs from the property window's spec tab after creating the particle object. |
![]() |
![]() |
Note |
|---|---|
| The tool inserts 2d particles perpendicular to the surface. It may happen that the surface normal points to the opposite direction from what was intended for hairs. If this happens, cancel the tool, take a top view and mirror the head. Mirroring inverts the normals. Then start the particle tool again. |
![]() |
13. Take a side view and set the created 2D particle object to its Edit state using the view's popup menu. Press the 4 key down and start dragging the lasso selector along the hair boundary. Draw a loop that includes all hairs that lie outside the hair-colored part of the head. 14. If the haircut is symmetrical, you can now click the Delete tool of the tool control bar. Otherwise take a top view and Alt-drag the hairs of the opposite side to remove them from the selection before applying Delete. Then repeat the selection and deletion from the opposite side. |
15. Turn off the Edit mode. Make sure the particle object is selected. Go to the property window's Spec tab and select the Geometry sub tab. Pick Length from the long attribute list and set it to 0.01 meters (1 cm is pretty good for this kind of simple haircut). Pick Diameter1 and set it to a small value like 0.001 (1 mm). Pick Diameter2 and set it to zero. You may try different values later but these should produce a reasonably good result.
16. Go to the Col tab and set the color of the hairs to the same color as you used for the hairbase material (0.6 0.3 0.2).
17. Test render and adjust the particle properties as required.
Most hair types have a subtle color variation. When you grow older (or a software product release becomes badly delayed), gray hairs start appearing. Let us add this property to the hair next.
18. Switch to the Materials tab of the Select window. Select New/VSL Material from the popup.
19. Rename the material as HairColor and using the property window, add the following VSL objects to it:
|
![]() |
20. Drag & drop the created material to the view window (hair particles should be still selected). A new test rendering finishes this tutorial.
|
![]() |