light
shadowspot(
	float	intensity	= 1,
	color	lightcolor	= 1,
	point	from		= point ("shader",0,0,0),	/* light position */
	point   to		= point ("shader",0,0,1),
	float	coneangle	= radians(30),
	float   conedeltaangle	= radians(5),
	float   beamdistribution= 2,
    string shadowname = "",
    float samples = 1,
    float width = 0
)
{
	vector A = (to - from) / length(to - from); /* direction */
	float	cosoutside= cos(coneangle),
			cosinside = cos(coneangle-conedeltaangle);
	float	attenuation, 	/* falloff from center of illumination cone */
		cosangle;	/* cosine of angle wrt center of cone */

	emit( from, A, coneangle ) {
		cosangle = - dot(L,A) / length(L);	/* A is already normalized */
		attenuation = pow(cosangle, beamdistribution) / dot(L,L);
		attenuation *= smoothstep( cosoutside, cosinside, cosangle );
		if( shadowname != "" )
		    attenuation *= transmission (Ps, from, "traceset", shadowname, "mindist", -1.0, "samples", (int)samples, "blur", width);
		Cl = attenuation * intensity * lightcolor;
	}
}
