How to cast hard shadow on ground plane?

posted to: Clip Art

Thank you for this tutorial - it's exactly what I'm looking for! I would also like to cast hard shadow on the ground plane, but can't figure it out. Can you show me how you would do that please? 

Below is a screenshot. I would like the monkey to cast a hard shadow on the ground plane, so that it's in the same style as the clip art. How would you do that with the ground plane being in flat clip art style as well, in exception to the hard shadow casted by the monkey? 

Here is my blend file: https://we.tl/t-5YU1zMntlv


  • Kent Trammell replied

    Good question. The main thing to keep in mind is that the clipart shader is using emission shaders to generate solid colors and minimize realistic shading gradients. This also means that the object is emitting light and will not accept shadows.

    So the first thing to do is swap the ground plane material for a simple diffuse shader (so it can accept shadows). Immediately you will see a shadow appear but you'll also see yellow light flowing on the ground and the shadow.

    Next step is some visual trickery on the monkey's material. In short you want the material to be different in the scene than it is in the camera. I.e. you want the scene to see the monkey head as a black diffuse material so it A) won't emit light on the ground but B) will cast a shadow. However you want the camera to see the emissive clip art shader. You can accomplish this with the Input -> Light Path Node. Add another mix shader to the end of your clip art shader and use the "is camera ray" socket of the Light Path node as the factor of the new mix node. Then add a simply black diffuse material to the first shader slot of the mix and your clip art output as the second shader socket.

    Those steps should deliver a crisp shadow on the ground plane while maintaining the solid emissive colors of your clip art material. Here's a screenshot of the two materials + result:

  • Cindy Suen(cindysuen) replied

    Very helpful, thank you so much for the detailed answer, Kent! What if I wanted the hard edge black shadow to be a different color, say orange, and the ground plane to be a light blue, how would I do that?

  • Kent Trammell replied

    Hmm we're getting pretty deep into the weeds now..I'm sure it's possible but I can't think of an easy way. That would involve lighting and shading trickery, possibly compositing too. Lots of unconventional tricks for sure.