We can do a fair approximation of wood with this approach as well. In Advanced Renderman, Anthony A. Apodaca and Larry Gritz describe a model for simulating the appearance of wood. We can adapt their approach to create wood shaders in GLSL. Following are the basic ideas behind the wood fragment shader shown in Example 8.21:
• Wood is composed of light and dark areas alternating in concentric cylinders surrounding a central axis.
• Noise is added to warp the cylinders to create a more natural-looking pattern.
• The center of the “tree” is taken to be the y axis.
• Throughout the wood, a high-frequency grain pattern gives the appearance of wood that has been sawed, exposing the open grain nature of the wood.
The wood shader uses the same vertex ...