/* Copyrighted Pixar 1989 */ /* From the RenderMan Companion p.352 */ /* Listing 16.16 Displacement shader to dent a surface */ surface bulb( float Ks = 1.0, Ka = 0.1, Kd = 0.3, Ksilh = 0.05, roughness = 0.1, silhrough = 0.55; color specularcolor = 1) { point Nf = faceforward(normalize(N), I); point V = -normalize(I); Oi = Os; Ci = Oi*Cs*(Ka*ambient() + Kd*diffuse(Nf)) + specularcolor*Ks*specular(Nf, V, roughness) + specularcolor*Ksilh*(pow(1.0 - (V.Nf),1/silhrough)); }