The experiments with ArahWeave have at last given some fruits, in the form of an include file to create fabric textures with POV-Ray, using as maps the images generated by this wonderful weaving program.
ArahWeave, even on the demo version, allows saving the fabric simulations designed with it as an image file. The best for a map would be an image of the fabric weave without shading nor interpolation (which can be done to some extent with the full version), but we can also use some tweaking on the simulation to flatten the output image.
This include file operates with two images generated with ArahWeave. First we need an indexed image to use it as a texture map, to give different colors and finishes to each yarn. To obtain this image, after designing our cloth with ArahWeave, we can get ride of the lustre of the yarns to avoid the shadowing (yarns properties can be accesed with F5). We should also select the best simulation, and save it as a 8-bit PNG with 300dpi or more depending on the size of the tile. The resulting image can be loaded into ArahPaint ,or any other image manipulation program, to convert it to indexed format and reduce the number of colors (the most apropiated for use as texture map with POV-Ray).
The second image we need is a bump map to use as normal with POV-Ray, so we can simulate the threading to some degree. This can be the same image for the texture map, but it looks better if we prepare with ArahWeave a second version of the fabric, changing the yarn colors to white and the background to black.
Optionally, we can generate a third image with the regular simulation, to use it as an image map to select yarns colors from it. But we can use also the texture map image if the colors are appropiated. Or we can use no image at all, and simply assign procedural colors to the yarns on the texture map, wich is much more fun… of course.
On the sample images below you can see the result of this technique applied to
some meshes generated with MegaPOV (using the cloth simulation). The images used for the fabrics design are mostly the examples bundled with ArahWeave, but I also used some found on the net:
- for drap-060930-3.jpg I used an image with chinese patterns by Ming-Ling
- for drap-061005-1.jpg a nice one with dogs by Mr.Oblivious.
- and for drap-061006-*.jpg a fine damask from The Inspiration Gallery.