/* Shader description goes here */ surface wgsTreeRadial(float Kfb = 1, /* fake brightness */ outer = 13, inner = 8.0; point center = point (0.0, 0.0, 0.0); color outercolor = color(0,1,0), innercolor = color(1,0,0)) //now use a custom coordinate system witha 3dplace node in Maya { color surfcolor = 1; point pnt; //float success = attribute("user:position", data); if(attribute("user:position", pnt)) { float dist = distance(transform("tree", center), transform("tree" ,pnt)) ; //printf("%1.3f\n", dist); //% reserver a space in the string //1 means //3 3 decimanl places float blend = smoothstep(inner, outer, dist); surfcolor = mix(innercolor, outercolor, blend); } /* STEP 1 - set the apparent surface opacity */ Oi = Os; /* STEP 2 - calculate the apparent surface color */ Ci = Oi * Cs * surfcolor * Kfb; }