Shadow-only shader?

Would it be possible to create a shader that will render only the shadows that the object receives? Of course that would be with the correct alpha so that the shadows can be composited. Is such a thing possible in OSL?

Thanks,

Stathis

Test rendering in progress…

up, matte shader will be awesome

Really nice Youpi :slight_smile:

I have found a solution for this problem , and works for me. Is a 3 steps solution but better then nothing( even in maya u need to do a small shader network for this so is not 1 click solution even there). Youpi, your osl shaders are awesome but unfortunately osl is cpu only and i cant use my GTX 560 TI.
So i did this :

  1. set the plane object invisible to camera from Ray Visibility and render objects on transparent background.
  2. Set only the objects invisible to camera and render only theyr shadow with difuse and a shadow pass of the plane.
  3. Use shadow pass from shadow only render as mask for combined shadow pass of plane only , and combine A over B on any bg u want, where A are the objects and B is the shadow, then u put any bg u want.

I hope it helps.