Friday, August 14, 2015

Shadow Plane

Oh my. Making a "shadow only" plane so that your 3D object casts a shadow on the ground is a pain in the tuchus with Cycles in Blender.
But. It can be done.
Dig this fellow's tutorial. David Fesliyan explains how to do it. It's a bit, er, convoluted. But it makes a clean shadow pass. (Do yourself a favor and make sure "compositing" is left checked in the render panel or you will be as confused as I was for a substantial amount of time earlier today.)
Ignore the unplugged lens distortion.
You have to put the shadow plane on one layer and then do things with nodes. Subtract, "set alpha" and then "alpha over". Make sure that layer receives shadows. Then move your sun(s) around so the shadows match your original image. And make sure that the outputs are in the correct order in "alpha over".
There seem to be other ways to do shadow planes in Cycles but this method does not involve putting a garbage matte in over the ground plane. And it seems to work.
I say seems. I know not am.
I think at full resolution this render takes about two hours on my fastest machine. But it should make a right pretty composite so I'll let it go for the weekend and see what I've got.


Kangas said...

Is there a reason to not just take your plane into After Effects, level its color down until it's solid black, blur it and lower the opacity, and you have a shadow of your plane?

Andrew Bellware said...

Well, there's full-motion happening on that plane. So each frame is brand-new. If it were a still that would totally work but you'd have to cut a matte around the plane (if I understand what you mean correctly).
But this way seems to work.

Aric Blue said...

I don't know if I explained my question well enough. Like, if you've already rendered out the plane by itself, with whatever movement is going on, then double that and put it underneath the plane. Turn it black, blur it and lower the opacity. Then you don't need a matte(because it's under the plane layer) and it will move exactly like the plane.

Andrew Bellware said...

It's the movement of the shadows cast on the plane that I'm trying to extract, not a shadow of a plane. There's a giant robot, who is lit on the side, and the plane I'm making is an invisible plane which is lined up with the ground in the final composite. Being the plane is invisible, but for the robot's shadow upon it, it should composite as though the robot's shadow is on the ground.