|
/* Surface shader that using only the diffuse lighting
component. Source code by Renee Tam.
*/
#pragma hint Kd float
#pragma label Kd "Diffuse Intensity"
#pragma hint surfcolor color
#pragma label surfcolor "Surface Tint"
#pragma hint texname image
#pragma label texname "Texture Map"
#pragma hint Ks float
#pragma label Ks "Specular Intensity"
#pragma hint roughness float
#pragma label roughness "Hilite Size"
#pragma hint hilitecolor color
#pragma label hilitecolor "Hilite color"
surface
cutrDiffuse(float Kd = 1,
Ks = 0.7,
roughness = 0.1;
vector surfcolor = {1,1,1},
hilitecolor = {1,1,1};
string texname ="/stuhome/vsfx419/Type name of new folder/zebra_001.jpg" )
{
vector n = normalize(N), /* the xyz vectors for the unit and */
nf = frontface(n, I); /* front facing normals */
vector diffusecolor; /* the rgb vectors for the lighting */
/* and the surface color */
diffusecolor = Kd * diffuse(nf);
vector i = normalize(-I);
vector speccolor = Ks * specular(nf, i , roughness) * hilitecolor;
vector texcolor = colormap(texname, s ,t);
Cf = Of * texcolor * surfcolor * (diffusecolor + speccolor);
}
|