home *** CD-ROM | disk | FTP | other *** search
- /* @(#)cgtexmap.sl 1.1 (Pixar - RenderMan Division) 9/28/89 */
- /* Texture Map shader for CrystalGraphics RIB files */
-
- surface
- cgtexmap( float Ks=.5, Kd=.5, Ka=1, roughness=.1; color specularcolor=1;
- string texturename = ""; )
- {
- point Nf, V;
- color Ct;
-
- Nf = faceforward( normalize(N), I );
- V = -normalize(I);
-
- if (texturename != "") {
- Ct = color texture(texturename);
- } else {
- Ct = Cs;
- }
-
- Oi = Os;
- Ci = Os * (Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
- specularcolor * Ks * specular(Nf,V,roughness) );
- }