home *** CD-ROM | disk | FTP | other *** search
- /* BMFunkyGlass.sl - Standard plastic surface for randomly colored glass.
- * (c) Copyright 1994, Larry Gritz
- *
- * The RenderMan (R) Interface Procedures and RIB Protocol are:
- * Copyright 1988, 1989, Pixar. All rights reserved.
- * RenderMan (R) is a registered trademark of Pixar.
- *
- * 14 Oct 1994 - (wave) changed named to BMFunkyGlass for name space reasons...
- *
- * last modified Oct 14 1994 by Michael B. Johnson (wave@media.mit.edu)
- */
-
-
-
- surface
- BMFunkyGlass (float Ka = .5;
- float Kd = .5;
- float Ks = 1;
- float roughness = .01;
- color specularcolor = 1;)
- {
- point PP, Nf, V;
- color Ct, Ot;
-
- V = normalize(I);
- Nf = faceforward (normalize(N),V);
- PP = transform ("shader", P);
- Ct = color noise (PP);
- Ot = Os;
- Ot -= Ct;
-
- Oi = Ot * (0.75 - 0.5*abs(V.Nf));
- Ci = Oi * ( Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
- specularcolor * Ks*specular(Nf,-V,roughness));
- }
-
-