/*
*
* FILE: tebALPaintedPlastic.sl
*
* DESCRIPTION:
*
* Contains:
*
* References:
*
* Copyright (c) 1997 Thomas E. Burge. All rights reserved.
*
*/
surface
tebALPaintedPlastic(
float Ka = 1.0;
float Kd = 0.5;
float Ks = 0.5;
float roughness = 0.1;
color specularcolor = 1;
float uscale = 1.0;
float vscale = 1.0;
string texturename = "";
string uarclengthmap = "";
string varclengthmap = ""; )
{
normal Nf;
vector V;
color Ct;
float ss;
float tt;
if (uarclengthmap != "")
{
ss = texture( uarclengthmap ) * uscale;
} else
{
ss = s * uscale;
}
if (varclengthmap != "")
{
tt = texture( varclengthmap ) * vscale;
} else
{
tt = t * vscale;
}
if (texturename != "")
{
Ct = color texture( texturename, ss, tt );
} else
{
Ct = 1.0;
}
Nf = faceforward( normalize(N), I );
V = -normalize(I);
Oi = Os;
Ci = Os*(Cs * Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
specularcolor * Ks * specular(Nf,V,roughness));
}
[Affine Toolkit]
[RIB Utilities]
[Bitmap Utilities]
[Handy Little Utilities]
[Libraries]
[Using the Libraries]