Thu, Jun 25, 2009

Papervision fur 3D texture

Before the advent of per pixel shaders, developers were creating faux-3D textures for things such as grass and fur by giving the target object several layers. If the layers are close enough together and the object is far enough away from the camera a texel will have the illusion of being a 3D strand.
Reproducing this in Flash was simple. Take a single texture, in this case tiger fur, and for each layer do a pixel dissolve, keeping less and less of the original texture intact as you work your way to the tip of the fur. Darken the layers depending on their depth to further the effect.
ViewportLayers are utilized to prevent the inevitable Z-depth fighting that would occur as a result of such close triangles. Finally a light blur is added to the group ViewportLayer to soften the edges.