#include "rmannotes.sl" surface tongue(float Km = .02, Ks = .9, Kd = .5, Ka = .01, roughness = .1, bumps = 180; color specularcolor = 1) { point diff_N,V,Nf; float flatness = 1, magnitude; color paper; paper = color (.45,.167,.167); /* calculate displacement & color, etc. */ diff_N = normalize(N) - normalize(Ng); P += -Km * noise (s * bumps, t * bumps) * normalize(N); N = normalize(calculatenormal(P)) + diff_N; Nf = faceforward(normalize(N), I); V = -normalize(I); paper = paper * Ka * ambient() + paper * Kd * diffuse(Nf) + specularcolor * Ks * specular(Nf, V, roughness); Oi = Os; Ci = Os * paper; }