surface leaf ( float Ka = 1, Kd = .8, Ks = .0, roughness = .3; color specularcolor = 1; string texturename = ""; ) { Ci = Cs; Oi = Os; if (texturename != "") { Ci = color texture (texturename); Oi *= float texture (texturename[3], "fill", 1.0, "width", 0.0); } normal Nf = faceforward (normalize(N),I); Ci = Ci * (Ka*ambient() + Kd*diffuse(Nf)) + specularcolor * Ks*specular(Nf,-normalize(I),roughness); Ci *= Oi; }