/* Shader description goes here */
surface
translucency12(float Kd = 1,
translucence = 1,
Km_vein = 1, /* [1 5] */
vein_repeats = 1, /* [1 5] */
s_freq = 1, /* [1 5]*/
t_freq = 1, /* [1 5]*/
darkspot = -0.5, /* [-.5 .5]*/
noise_amp = 1; /* [1 5]*/
color base = color(0.572,0.768,0.317),
tip = color(0.980,0.784,0.447);
float tipbias = 1; /* [1 5]*/
string veinmap = "")
{
//color map
color surfcolor = mix(base,tip,pow(t,tipbias));
normal n = normalize(N);
normal nf = faceforward(n, I);
//spotiness
float spotty = noise (s * s_freq,t * t_freq);
spotty = (spotty + darkspot) * noise_amp;
Oi = Os;
color diffFront = Kd * diffuse(nf);
color diffRear = Kd * diffuse(-nf);
//Do we have a map?
float density = 1;
if (veinmap != "")
density = texture(veinmap, s / vein_repeats, t / vein_repeats) * Km_vein;
color diffTotal = diffFront + (diffRear * translucence * density );
diffTotal = diffTotal * Kd;
Ci = Oi * Cs * surfcolor * diffTotal + spotty;
}