// Uses the facing ratio (dot product) to mix two colors.
void Velvet (float rim_width;
color inner;
color edge;
output color cresult)
{
normal n = normalize(N);
normal nf = faceforward(n, I, n);
vector i = normalize(-I);
float dot = 1 - i.nf;
dot = smoothstep(1 - rim_width, 1.0, dot);
cresult = mix(inner, edge, dot);
}