How to use a lamp only to cast shadows?

Hi. I am totally new to the compositor tab in blender.
Actually I am realizing while in the studio how important is to understand this aspect in Blender.

I added a sun to my scene, but I want it only to cast shadows (the light flattens the object and that is not what I am looking for). I researched a little bit online, but I have only find solutions in really old Blender versions. I am not able to replicate the same workarounds in 2.9. I am sure its possible, but since I am totally foreign to the composition part…I am not finding it.

Basically the solution I found is via render layers…and having one that is the scene without the sun and one that is only the sun shadow…but I am not understanding how to do it.

Do anyone in the community can guide me to find the way of doing this? Also and most important: Do you know any Compositor in depth course (I am willing to pay any price hahah) ?

Thank you

I don’t know any course but as a Blender user for the last 5 years I’m 100% sure almost all Compositor tutorials in Youtube are still valid today (the Compositor sadly didn’t change a lot like the rest of Blender).

You can use Render Layers but there are other ways:

  1. Light Paths with the “Light Path” node in a shader (also all tutorials you’ll find are still valid, works 100% in Cycles but not fully supported in EEVEE)
  2. In the object tab (examples below, only Cycles).

No Camera pass

No shadow pass, etc

  1. The new and maybe easiest way: collections with the “Indirect Only” checked (the white arrow). Indirect only is the same like toggling off the Camera Rays (you don’t see the object but you see its shadow, reflection…). The indirect pass is hidden by default in the outliner.

Thank you. I did not know the feature within collections. Quite handy.

1 Like