brian over from from the pixar forums has been helping merge the displacement from the rcskin shader
and a skin shader which someone posted on the 3delight forums a while back.
anyway the shader is nearly complete with the exception of this error.
skin_shader.sl: in function SSS_2
skin_shader.sl:45: WARNING: variable 'Nn' should be normalized
[james@animation-desktop ~]$
#define snoise(p) (2 * (float noise(p)) - 1)
surface SSS_2
(
color base_color = 1;
string color_map = "";
float diffuse_weight = 1;
float specular_weight = .1;
float specular_roughness = .04;
float ambient_weight = .1;
float poresfreq = 60,
poresthresh = 3,
poresdepth = -0.001;
)
{
point PP = transform ("shader",P) * poresfreq;
float turb = 0;
float maxfreq = 8;
float f = 1;
for (f = 1; f< maxfreq; f *= 2)
turb += abs(snoise(PP * f)) / f;
turb = pow(turb,poresthresh) * poresdepth;
/* displace normals*/
//if you want to do ACTUAL displacement, not just bump mapping uncomment below
//P = P + turb * normalize(N);
normal Nn = calculatenormal(P + turb * normalize(N));
normal Nf = faceforward(normalize(Nn),I);
vector V = normalize(-I);
color color_tx = 1;
if (color_map != "") color_tx = texture (color_map, s, t);
uniform string raytype = "unknown";
rayinfo( "type", raytype );
if( raytype == "subsurface" )
{
Ci = ambient_weight * ambient() + (diffuse_weight * diffuse(Nn)) * (base_color * color_tx);
}
else
{
Ci = subsurface(P) + specular_weight * specular(Nf, V, specular_roughness);
}
}
any help would be appreciated
james