DirectX® 9.0 and SmartShader™ 2.0 White Paper
Bear

This demonstration showcases some of the advancements in real-time
fur rendering made possible with DirectX 9.0. The bear's fur
is generated using vertex and pixel shaders to implement an
improved version of the established "shell and fin" fur rendering
method. Besides looking considerably more realistic, these new
shaders provide a much greater degree of control over the fur's
appearance and behavior than was possible before.
Real-time fur rendering is accomplished by first using a vertex
shader program to "dilate" a 3D model. This involves creating
new shells or layers of polygons that completely encase the
original model. The locations of the vertices in a new shell
are determined by taking the co-ordinates of the vertices in
the layer below and extending them outward in the direction
of their normal vectors.
By applying this technique recursively, any number of shells
can be applied to control the length and quality of the fur.
The more shells, the longer the fur, but each additional shell
significantly increases the polygon count of the scene, which
can degrade performance if the number of shells gets too large.
It is possible to increase the spacing between the shells to
get longer fur with fewer polygons, but if the spacing becomes
too large, the individual hairs will cease to appear solid,
resulting in a much less realistic image.
Once the shells have been generated, a pre-generated fur texture
is applied to each layer. These textures are largely transparent,
except for a series of spots that correspond to individual hair
strands. When these textures are closely stacked one on top
of another, they produce the appearance of solid strands of
hair. The effect can look quite realistic, as long as the shells
are not viewed edge-on. Because the fur textures are only two-dimensional,
they become invisible around the edges of a 3D model, where
they are viewed edge-on.
To address this issue, the vertex shader must generate additional
polygons called "fins" that radiate out from the polygon boundaries
in the original model. The length of the fins corresponds to
the distance of the farthest fur shell from the base model.
The fins are then textured to appear partially transparent with
individual strands of fur. The combination of the fins and shells
ensure that the fur stays visible regardless of the viewing
angle. |
Fur Parameters
- Fur can have a limitless variety of appearances. The fur
textures used in the Bear demo were generated procedurally
using a tool called FurGen, developed by ATI. This tool
makes it possible to control a wide range of fur parameters,
including:
-
- Number of shells
- Maximum height of fur
- Resolution (texture size)
- Density (hairs per unit area)
- Hair thickness at base and tip
- Hair length
- Direction of hair growth
- Hair curliness
Each of these parameters can be fixed for the entire surface,
varied according to a random distribution, or sampled from other
textures. The fur textures are all filtered and mip-mapped in
order to avoid artifacts that can otherwise appear when the
fur is viewed from very short or very long distances.
Anisotropic Per-pixel Lighting
Common materials like metal and plastic tend to reflect the
same amount of light regardless of the viewing angle or the
direction of the light. Fur, hair, and other materials made
up of many small strands behave differently. These materials
can reflect varying amounts of light (and thus appear shiny
or dull) depending on the viewing angle and the location of
the light source.

To faithfully reproduce this effect, an anisotropic lighting
model is required. Given the incident light angle and viewing
angle for each pixel, the pixel shaders used in the Bear demo
look up a special texture that determines how reflective that
pixel will be. This texture is generated at the same time as
the other fur textures, and controls how lustrous or dull the
fur will appear. Anisotropic lighting is essential to giving
the fur its characteristic sheen as the bear moves its head.