/*Evan Pon
  cs184-ej
  Jenny Huang
  cs184-bd */

/* Our wallpaper shading for our two walls.  It takes advantage of the fact
   that either s or t can be made to hover right around 0.  This produces
   a random speckling effect under bmrt- although it doesn't really work 
   under renderman in the labs.  */

surface
xwallpaper(
	float 	Ka = 0.5, 
		Kd = 0.75, 
		Ks = 0.25,
		roughness = 0.1;  
	color 	specularcolor = 1,
		background = (.6, .1, .1),
		speckle	= (.3, .1, .6);
)
{
	color currentcolor	= color (1, 1, 1);
	normal Nf;
	
	
	if (s < 0) {
		currentcolor = speckle;
	}
	else if (s > 0) {
		currentcolor = background;
	}
	Nf = faceforward (normalize(N),I);
	Oi = Os;
	Ci = Os * ( currentcolor * (Ka*ambient() + Kd*diffuse(Nf)) +
	      specularcolor * Ks*specular(Nf,-normalize(I),roughness));
	
}