#include "rmannotes.sl" displacement dented ( float depth = 0.10, lacunarity = 2.17) { float magnitude = 0.0, size = 1.0, i; point P2; P2 = transform("shader", P); for (i = 0; i < 20.0; i += 1.0) { /* Calculate a simple fractal 1/f noise function */ magnitude += snoise(P2 * size) / size; size *= lacunarity; } P2 = P + normalize(N) * clamp(magnitude, -1.0, 1.0) * depth; N = calculatenormal(P2); /* P = P2; THIS IS COMMENTED OUT FOR BUMP ONLY */ }