Compositing Light and Shadows onto image

I have a scene with a ufo (abducting a cow) and I want the light from the ufo to affect the ground and also want the shadow of the ufo on the ground. I’m using a method of multiple render layers and a divide node, I can’t get a clean result, I always end up with noise artifacts from the render where there shouldn’t be any. basically, could someone tell me the basic setup for isolating shadows AND light. Sorry I can’t provide my node setup (I destroyed it out of frustration)

BTW I thought I could have two render layers, one with the plane catching the light and shadows and one blank and then subtract one from the other in compositing, didn’t work…

check this out.

Generally, “treat light and shadow separately!”

After all, “light” is “the injection of elevated pixel-values into a portion of the screen-image where they ordinarily would not be,” while “shadow” is precisely the opposite. Therefore, deal with one, then the other, and finally, “mix the two.”

This has the advantage … very important when compositing … of creating “pure” data channels. A channel which describes only shadows. Separate channel(s) that describe only light. And so on. You can more easily mix such channels because they do not overlap with one another. They do not contain the same information.

Incidentally … shadow-calculations are one of the biggest time-wasters. Furthermore, too-many shadows (even if physically correct …) can make a scene look busy. You must have shadows to create the 3D illusion on a flat screen, but you might not wish to have all of the shadows present, that would actually exist in real life.

Consider using light-sources that do not cast shadows, then use “shadow-only spotlights” (which create shadows, but not light …) to place the shadows where you actually want them. Using compositing and render-layers, you can then extract just this shadow-data, adjusting the intensity, and maybe giving them a slight blue tint to mimic sky-color.