4
* Displacement Shader "borg_metal" -- adds a Borg-like metal appearance
8
* (off-campus student from NASA Goddard Space Flight Center)
10
* (This is a variation on the "dented" shader from
11
* _The_RenderMan_Companion_ by Steve Upstill.)
15
borg_metal(float Km = 0.5)
20
float smod = mod(s * freq, 1);
21
float tmod = mod(t * freq, 1);
28
P2 = transform("shader", P);
30
for(i = 0; i < 6.0; i += 1.0)
33
mag += abs(.5 - noise(P2 * size)) / size;
38
P = P2 + normalize(N) * (mag * mag * mag) * Km;
40
N = calculatenormal(P);