light dirOccLight(float intensity = 1, samples = 64, //ignored for point-based occlusion multiplier = 2, coneangle = 90, clampOcc = 1, bias = .001; color lightcolor = 1; string pntCloud = "") { vector direction = vector "shader"(0,0,1); float occ; /*we pass the reverse of the "direction" variable because we want to sample from the point of view of the surface, but not from its normal, instead from its angle to the light source*/ solar(direction, 0.0) { if(pntCloud != ""){ occ = 1 - occlusion(Ps, -direction, samples, //tells renderer to do point based occ "pointbased", 1, //tells it where to find the ptc file "filename", pntCloud, //clamps the occ to keep it from being too dark "clamp", clampOcc, "coneangle", radians(coneangle), "bias", bias ); } else { occ = 1 - occlusion(Ps, -direction, samples, "coneangle", radians(coneangle)); } occ = pow(occ, multiplier); Cl = occ * intensity * lightcolor; } }