[Bf-committers] Colored Shadows

Roland Hess rolandh at reed-witting.com
Thu May 29 21:21:08 CEST 2008

I've made a patch that allows lamps to color their cast shadows, which 
consequently allows you to control shadow density per-lamp without 
adjusting overall lamp energy.

Link here:

And text from the patch entry here for the lazy or only tangentially 

This patch provides a control for changing the color (and thereby the 
intensity) of cast shadows, on a per-lamp basis. This is useful for 
trick effects (weird club lighting), as well as subtle shading in scenes 
(cooling or warming shadows).

The main use, though, is in changing shadow color to shades of gray, 
which has the effect of lowering shadow intensity without altering the 
overall energy of the lamp. Many times in my own lighting rigs, I am 
happy with the quality of lighting but find that shadows are too dark. 
Setting shadow color to, say RGB (.5, .5, .5) has the effect of cutting
shadow density in half without having to add additional light sources 
that could effect your overall scheme. This has cut some of my lighting 
rigs in half, as I no longer have to have two-lamp clusters for every 
light source (one for lighting energy and one set to Only Shadow for 
shadow intensity). Setting shadow color to white RGB (1,1,1) causes the
shadow to effectively disappear, as though shadows were not enabled.

The colored shadowing technique plays nice with all of Blender's 
shadowing types (ray, buff-halfway, buff-irregular), lamp types (spot, 
sun, area, point), ray options (soft shadow, area lamp with samples), 
and transparency (irregular buff alpha and ray transp + filter). It also 
works for Only Shadow, and processes into passes correctly as 
demonstrated in the provided test .BLEND files.

One other fun feature is the TEX button beside the color swatch, which 
causes the lamp texture to affect the shadow as well (it normally does 
not). The effect produced is one that has the lamp's texture seem to 
"pass through" the object and integrate with the shadow for special effects.

And ba.org post with sample renders:


More information about the Bf-committers mailing list