#include "dist2cell_def.h" #include "/opt/pixar/RenderManStudio-2.0.1-maya2008/lib/slim/include/pxslRemap.h" surface v_test(float Kd = 1, Km = 0.05, cellfreq = 5, shape_rad = 0.5, shape_freq = 8, shape_amp = 1, mindist = 10, maxdist = 15, bias = 0.5, gain = 0.5; string spacename = "shader") { color surfcolor = 1; normal n = normalize(N); //normal nf = faceforward(n, I); float d = dist2cell(P, spacename, cellfreq); /* float rad = shape_rad; if(d <= rad) Oi = Os; else Oi = 0; surfcolor = 1 - smoothstep(mindist, maxdist, length(I)); d = pxslFloatBias(bias, d); d = pxslFloatGain(gain, d); // Displacements float hump = 1 - d; P = P - hump * n * Km; N = calculatenormal(P); n = normalize(N); surfcolor = 1 - d; color diffusecolor = Kd * diffuse(n); Ci = Oi * Cs * surfcolor * diffusecolor; }