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?

Asked
Active
Viewed 2.0k times
16
Paul Gonet
- 33,368
- 17
- 91
- 171
2 Answers
15
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.

Paul Gonet
- 33,368
- 17
- 91
- 171
-
4Shadow ray is the proper way to do this as camera ray will color reflections as well which will be noticeable in more complex scenes. – PGmath Dec 23 '16 at 04:05
-
This doesn't seem to work when the shadow is cast on a shadow catcher, is there a workaround for that? – rraallvv Mar 06 '19 at 15:18
-
This doesn't work with the self-cast shadows – Unknow0059 Jan 07 '24 at 07:17
8
An alternative way to do this is to make the light have different colors for direct and indirect rays:

