Make a light only cast shadow in Cycles

Hello everyone! I am working on scene right now and I just can’t seem to figure out (or remember?) how to create a light that only casts a shadow.

If I want the light to not cast a shadow, I just have to untick the “Cast Shadow” box, but what should I do to make it ONLY cast shadow? Not contributing to any other light.

Thanks in advance!

One option is to enable shadow on the Passes tab for your render layer and use that in the compositor.
Other is to change the visibility of your object in the Ray Visibility tab so that only the shadow remains.

Answer deleted: because I did not read the question correctly.
Or maybe I read it correctly, but didn’t assimilate it correctly.

You can’t make a light that only casts shadows in Cycles at the moment, because shadows are not a property of lamps, they are a property of the objects that cast them.

Okay, that’s too bad. I am reading “Digital Rendering and Lighting” by Jeremy Birn and I really like the idea of manually placing the shadows in your scene, so you have one lamp for the light and one for the shadow.

Thanks for your answer!

You can do this in BI. It helps to think of Blender having two engines, one for physically accurate (cycles) where you have to accept most physical realities and one where you can mess with those realities but you have to give up some physical accuracy like bounce illumination.

You can read the solution in that book, too:

“If your software does not support either of the techniques just described, there’s another way to create
an identical effect. This works in any program that supports negative lights.
Start with two copies of a spotlight in the same place. Give the first light a positive intensity of 1 and
set it to cast shadows. Give the second light a –1 intensity but do not set it to cast shadows. These
two lights work as a pair; the first light adds illumination (except where it is shadowed), and the
negative light subtracts all of the illumination added by the first light, effectively canceling it out. The
negative light also takes light away from the area where the first light was shadowed.Shadows-only lights can be tremendously useful if you want to control the exact size, angle, and
perspective of your shadow without changing the lighting of the scene. You can even light the scene
with several lights that don’t cast shadows—such as the red, green, and blue lights in Figure 3.14—
and then use a shadows-only light to add a single, consolidated shadow to an object.”

2 Likes

Out of curiosity, how do you negate light? I mean, properly. Last I tried negating lights simply by multiplying with -1, things didn’t really turn out so well :smiley: Maybe I did it wrong, was a long time ago.

You can set the power of the light to -x W, or in node editor you can use -1.0 as strength value.

Wow, an answer to my question 5 years later! :slight_smile: Thanks a lot, I will give it a try! Hopefully this technique will work well for the short film I am working on.

1 Like

You can bake the texture with only color, and than set it to the lights emission with nodes.

A rendering algorithm can either work forward from a light source, looking for things that it illuminates, or backward from an object to find what illuminates it. My understanding is that Cycles falls into the second category.

The “shadow-only spotlight” is a very nice thing to have.

WTF! You definitely sold that book to me just now. This is the most useful piece of information I got from somewhere like since years. And it literally presented itself with a crazy animation. It was like a horror movie when I unticked the cast shadow on the negative light. I set my workflow on openimagedenoise to start on first sample so it was really scary to watch all the light getting sucked up running to blueish dark color and then the scene illuminates back. But there is a cool and realistic looking color gradient on the shadow. It mixes up with the hdri texture!

1 Like