I want to change the color of the shadow casting by a cube to green. While it's very easy to do it in Blender Internal (you select the lamp, go to the Lamp data header and change the shadow's color in the Shadow panel) in Cycles there're no such options. How to achieve it in Cycles?
2 Answers
With the Cycles renderer enabled select the cube, give it a new material and set the material nodes as pictured below. Use the Is Camera Ray of the Light Path node as a factor for mixing the Diffuse and Transparent nodes (Is Shadow Ray works good as well).
Change the Hue, Saturation and Value values of the Transparent shader to change the shadow's color, intensity and transparency.
-
4$\begingroup$ Shadow ray is the proper way to do this as camera ray will color reflections as well which will be noticeable in more complex scenes. $\endgroup$– PGmathDec 23, 2016 at 4:05
-
$\begingroup$ This doesn't seem to work when the shadow is cast on a shadow catcher, is there a workaround for that? $\endgroup$– rraallvvMar 6, 2019 at 15:18
An alternative way to do this is to make the light have different colors for direct and indirect rays: