Shade trees provide the ability to contol every part of the shading calculation. This allows the
user access to both 'classical' shading models and experimental. Shaders can even be developed
for a specific scene, producing (for lack of a better term), elegent hacks.
An example shade tree for a plastic shader might look like the following:
The above shading tree, written in the RenderMan shading language looks as follows:
surface
plastic (float Ka=1, Kd=0.5, Ks=0.5,Roughness=0.1;)
{
point Normal=faceforward(normalize(N),I);
point Viewer = normalize(-I);
Oi=Os;
Ci=Os*(Cs*(Ka*ambient()+Kd*diffuse(Normal))+
Ks*specular(Normal,Viewer,Rougness));
}