Hi , All
I am learning shaderwriting . I have write a shader for PRMan and i am rendering it in maya . I wanted to add output channel shadow, unshadowed , specular, normal . I have tried shadow channel using lightsource function but some how it is not working . so anyone please help me to add these perticular channels (AOV) . here is sl code
surface plastic_texture(
float ka=0.8,
kd = 0.8,
ks=0.6,
roughness = 0.4;
color specularcolor = (1,1,1);
color diffcolor = (1,1,1);
color opac =(1,1,1);
string ColorMap = “”;
)
{
normal nf = faceforward(normalize(N),I);
vector V = -normalize(I);
color speccolor = 1;
Oi = opac;
if(ColorMap!="")
{
Ci = Oi * texture(ColorMap,s,t) * (kaambient()+kd diffuse(nf)) +specularcolorksspecular(nf,V,roughness);
}
else
{
Ci = Oi diffcolor * (kaambient()+kd diffuse(nf)) +specularcolorks*specular(nf,V,roughness);
}
}
