1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- /****************************
- Shadowed Spot Light Shader
- (c) Mad Processor, 2009
- As with all baking-compatible
- shaders, one should not use
- the faceforward() call.
- *****************************/
- light lm_light_shadow(
- 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 __category = "shadow";)
-
- {
- uniform vector A = (to - from) / length(to - from);
- illuminate( from, A, coneangle )
- {
- //standard shadow
- color shad = shadow( shadowmap, 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 = clamp((1-shad),0,1);
- //Cl = intensity * lightcolor;
- }
- }
|