16
$\begingroup$

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? enter image description here

$\endgroup$

2 Answers 2

15
$\begingroup$

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). enter image description here

Change the Hue, Saturation and Value values of the Transparent shader to change the shadow's color, intensity and transparency. enter image description here

Here's the animated test using the changes mentioned above: enter image description here

$\endgroup$
3
  • 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$
    – PGmath
    Commented Dec 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$
    – rraallvv
    Commented Mar 6, 2019 at 15:18
  • $\begingroup$ This doesn't work with the self-cast shadows $\endgroup$
    – Unknow0059
    Commented Jan 7 at 7:17
8
$\begingroup$

An alternative way to do this is to make the light have different colors for direct and indirect rays:

1

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .