|
Text hb_plastic.sl prepare.rib interact.sl interact.rib Makefile surface hb_plastic( float Ks=0.5; float Kd=0.5; float Ka=1; float roughness=0.2; color specular_color=1;
output varying color Cambient=0; output varying color Cdiffuse=0; output varying color Cspecular=0; ) { normal Nf; vector V;
Nf=faceforward(normalize(N),I); V=-normalize(I);
Cambient = Cs*(Ka*ambient()); Cdiffuse = Cs*(Kd*diffuse(Nf)); Cspecular = specular_color*Ks*specular(Nf,V,roughness);
Oi = Os; Ci = Os*(Cambient+Cdiffuse+Cspecular); } |