/**************************** Shadowed Spot Light Shader (c) Mad Processor, 2009 As with all baking-compatible shaders, one should not use the faceforward() call. *****************************/ light lm_light_spot( float intensity = 1; color lightcolor = 1; uniform string shadowmap = ""; uniform float blur = 0; point from = point "shader" (0,0,0); point to = point "shader" (0,0,1); float coneangle = radians(30); float conedeltaangle = radians(5); float beamdistribution = 2; float decay = 2.0; float __nondiffuse = 0, __nonspecular = 0; float samples = 32; string bakefile = ""; string __category = "";) { uniform vector A = (to - from) / length(to - from); illuminate( from, A, coneangle ) { //standard shadow color shad = shadow( "raytrace", Ps, "blur", blur, "samples", samples ); //float distance_squared = L.L; //float distance = sqrt( distance_squared ); //float cosangle = L.A / distance; //color shad = transmission( Ps, from, "samples", samples, "samplecone", blur, "bias", .08 ); //Cl = atten * (1-shad) * intensity * lightcolor; //Cl = (1-shad) * intensity * lightcolor; //Cl = intensity * lightcolor; //Cl = 0; Cl = intensity * (1-shad); } }