Dave Cope's Homepage
   Main | Personal | Photo Gallery | Projects | Linux | Employment Info. | Links | Misc. | About e-mail  

Shader Tree


I implemented a shader tree so I could combine simple textures into more complex textures. The shader tree makes use of the procedural texturing system in my raytracer, as well as "function" objects.

Procedural shaders are used to combine other materials. For example, a shader may have two child materials that are combined into a single material. Most of the procedural shaders that combine textures also make use of function objects that are evaluate per pixel just like the materials. The function objects are used in many ways. Most commonly function objects are used to select or weight the child materials.

Here is a very simple demonstration of materials can be combined into a more complex material using a shade tree.

This is a simple material. It is called called 'blue' in the TCL script.
This is a simple material. It is called called 'green' in the TCL script.
This material is called 'combo'. It is a combination of the 'blue' and 'green' materials. Two perlin noise functions that are summed together into a single function are used to distribute the texture. If the value of the function is greater than zero, the resulting material is 'blue'. Otherwise the material is 'green'. This demonstrates how material can be combined together in a tree structure.

This material is called 'bumpyCombo'. It is created from a bump-mapping shader that has the 'combo' texture as a submaterial. This demonstrates how a material can be composed with another.

Even more complex materials can be created by combining materials into a larger tree. For example, the mountains that I have rendered are meshes with a single material attached.


This site was designed and coded by Dave Cope - © 1998-2003