/* * emboss(): Use a texture map to perturb the surface normal. */ displacement emboss (string texname = ""; float depth = 1.0) { float magnitude; point P2; P2 = transform("shader", P); magnitude = texture(texname); P2 = P - normalize(N) * (magnitude) * depth; N = calculatenormal(P2); P = P2; }