rendering shadows separately

Hello,
Could anyone point me in the right direction? I am trying to render shadows, highlights and plain color separately so I can combine them later in after effects and have some room for tweaking.
So far I couldnt work it out with the notes. The renders of the shadows look strange(no smooth shadows) and is lacking transparency.
A tutorial about this topic would be handy.
thanks in advance
jurjen

For 2.49b or earlier:

From your description it sounds like you’re using the Shadow Pass option in the render pipeline. I’ve found this to be less than useful because of the problem you mention.

Not sure what “colors” you want to separate out, but for shadows you can set things up so that they are cast on objects on their own layer/render layer, then render this out as a separate pass. I’ve done this for re-combining the shadow in Blender’s Compositor, similar in some ways to AE I imagine.

My process used intensely black shadows cast on a pure white “proxy layer” with objects matching those on which the shadows are cast in the “beauty” layers. This takes some clever setup of shadow-casting objects, lights and proxy objects, but works well because occlusion is automatically included (how’s that for a near non sequitir?). In Blender I used a Color>Multiply node to modulate the shadow intensity when it’s laid over the “beauty” render pass. There are of course other possible methods, but this illustrates how separating the shadow pass as a discretely rendered layer can be useful.

1 Like

Thanks Karl,
So if I understand it well, you kine of duplicate the scene. One scene you would render shadeless and the other would be for shadows only? That trick could work but sounds a bit complicated.

I thought it would be something simple but so far I couldn’t figure it out yet.
thanks

It’s even a little more complicated than that, actually. And I used Layers and Render Layers to separate the various elements, not different Scenes. Scenes would work but I thought it a little too complex for the project I was doing at the time.

The “beauty pass” I rendered with normal lighting and texture values, not shadeless. This provided the “simple” static shadowing and also the AO if any. The items that were to cast “FX” shadows (meaning as a separate element for compositing) were set up to not cast shadows on this part of the scene during the “beauty pass” rendering.

For the shadow pass, with a simple scene it’s probably easier to make duplicate objects and give then a pure white material, no specular, just all diffuse. You can’t use Shadeless because shadows aren’t cast on a Shadeless Material. So lighting this “shadow element” layer was a bit tricky because all you really want are the cast shadows. For the Lamps & Objects casting the shadows you may want to use the “Shadow Only” options, but that’s dependent on the scene setup to a large degree.

So yeah, it’s pretty complicated, but the results can be worth the effort. The only example I have is this quickie live-action/CGI composite using a camera track:

Skunky Beer! featuring ManCandy

In this case the shadows of MC’s arm and hand are overlaid on various live-action and CGI surfaces. The fact that it’s hard to see the trick is good – it’s supposed to be naturally “unnoticeable.”

1 Like

One thing that’s really handy to use is the “shadow-only material.” It has no color of its own, but it does receive shadows. You can enter such a material in the “Mat:” setting of a RenderLayer, thereby forcing every object that this layer “sees” to use this material without actually altering the object itself.

I always go for a “pure,” black-and-white (gray scale…) shadow channel, then usually I color it in some way in the downstream stages. All I want to see is a pure representation of where the shadow is, and how dense it is. If more than one shadow contributes to a region, I grab each one in isolation, then feed it through a “darken” mixer.

It definitely reminds you why an audio mixing-board is so wide. “All those channels” take a bit of planning but they sure do give you an unbelievable amount of control to finesse your image.

1 Like

Excellent! I hadn’t known of this approach, sounds good. Thanks for sharing!

Thanks for the input!
I have thought about the option suggested by Sundial. The problem is that it will only give me “extra shadows” and so not really helpful for me if there is no plain colors to put it on. Plus I need a layer for the highlights as well.
I am getting the idea its not possible what I would like to do, even thou it seems so simple. Or I am trying to do something that is pointless anyway.
the intensity of shadows and highlights can be adjusted by levels or curves in ae anyway. however I was hoping if have the shadows on a separate level I could blur it a bit and improve the overall look of it. but this could be done with those extra shadows …blabla…
anyway thanks again

The entire point of my suggestion, Jurjen, is that this will give you a “clean” channel of information consisting of nothing but shadow information. The faces which receive the shadows are “not there,” and neither are the faces which cast those shadows. Yet, since this is being done by an override in the RenderLayer, not the model, you can get it without disturbing the model. (The ability to designate which lights are to be considered by the RenderLayer is also quite-obviously there for the same purpose.)

“I’m not quite sure why you’re giving up on this quite so easily,” if I may cautiously and respectfully say so, “when the path before you is quite clear.”

What you really want to do, in this and in most every other rendering case, is to isolate the various aspects of your scene so that you can deal with them individually. This means among other things that “shadow” and “light” are separate; “specular” and “diffuse” lighting is separate; “moving” and “non-moving”; light from different sources. You can, if you wish, do utterly impossible things, like cause light and/or shadow to shine right through something that is obviously in the way of the beam. You do whatever you need to do to get those layers of information (saved in “MultiLayer” files with RGBA), so that you can composite them together with one another in the final steps.

Consider what happens every day at a recording studio here in Nashville, Tennessee: first the drummer goes in and records his part. Then the bass, piano, and guitar, each one recorded as an isolated track (even if they are in the same room together while recording, which is rare). Backup singers croon in an otherwise empty set of rooms. Then the talent arrives. Soon you’ve got fifty, sixty, a hundred separate “tracks,” all with time-code that lets them be locked-in together. And now the mixing gods, then the mastering goddesses, work their magic with their computers. And it is what they create, that you finally hear on the radio.

The only time that everything comes together in one room at one time is on WSM (or http://www.wsmonline.com …) on Saturday nights at the Grand Ole Opry, or, better yet, on Wednesday nights (7-9 PM CST) with Music City Roots. “Live music. Ain’t nothin’ comes close.”

(and, uhh, yeah, that is “a plug,” just not a commercial one. :yes: If you dig that sound and you’re otherwise just waiting for another render …)

Thanks Sundial. I am not going to give up as I havent reached my goal yet. The goal is to improve my renders I wanted to make something like this http://www.thefwa.com/library/bluemotion2-INWA.jpg
I figured out that the set up (lights materials etc.) has to be improved first. I found this tutorial about yafray.I havent tried yafray yet but the guy gave a good tip already and that is to render first with one material. so you can focus one the light set up.

The trick you suggested works fine for the shadows but how do I get plain colors and highlight separately?
(But it does answer the question in the topic header.)

Even thou I have worked with blenders for years I havent paied much attention to renders. I am lacking knowledge one this level.

thanks

The easiest way is to define a default “Grey” material then type that into the Material box of the RenderLayer(s) in question. This will force all of the objects affected by the layer to (for the purposes of that layer only) be rendered using that material. It’s the same principle that you use with 'shadow-only materials" as previously described.

Another thing that is easily overlooked (besides the importance of “linear workflow”) is to make sure that the sum of the specular plus diffuse lighting values do not exceed “1.0.” Unless an object is glowing, it cannot give off more light than it receives.

Look at the various possible outputs of a RenderLayer. There’s an “everything” (Combined) output and individual ones. The passes you are looking for are the so-called diffuse and specular colors. Once you request them to be output, they will appear as outputs on the RenderLayer node. (You can also omit them from the Combined pass.)

Don’t feel rained-on on that score! :spin: I’m lacking knowledge on most levels… still!