/* Shader description goes here */
surface
constant_test(float	Kfb = 1,	/* fake brightness */
				upper,
				lower;
	color		uppercolor = color(0,1,0),
				lowercolor = color(1,0,0))
{
color	surfcolor = 1;


point data;
float success = attribute("user:position", data);

if(success) {
flaot ydist = ycomp(data);

float blend = smoothstep(lower, upper, ydist);
surfcolor = mix(uppercolor, lowercolor, blend);

/* STEP 1 - set the apparent surface opacity */
Oi = Os;

/* STEP 2 - calculate the apparent surface color */
Ci = Oi * Cs * surfcolor * Kfb;
}
