Example 3: Surface Attributes

Text    hb_plastic.sl    prepare.rib    interact.sl    interact.rib    Makefile

interact.sl

surface main( varying color Cambient = 0;

varying color Cdiffuse = 0;

varying color Cspecular = 0;

varying float Froughness = 0;

)

{

N=normalize(N);

Oi = Os;

Ci = Os * (Cambient*ambient() + Cdiffuse*diffuse()

+ Cspecular*specular(N, -normalize(I), Froughness));

}