--- Operating System, Graphics card ---
Mac OS X 10.8.2.
2.3 GHz Intel Core i7
NVIDIA GeForce GT 650M 1024 MB
--- Blender version with error, and version that worked ---
r54535 (shadow pass results in all black for non-light illumination)
r54417M (it generates shadow pass correctly in this version)
--- Short description of error ---
On newer builds I cannot get a proper shadow pass for shadows cast by mesh (emission) lights or environment variable (HDR) lighting. This is both for CPU and GPU renders. It was working fine in previous versions (e.g. r54417). If there are no lights in the scene the shadow pass is completely black.
--- Steps for others to reproduce the error (preferably based on attached .blend file) ---
1. Create a plane and a cube with plain, white diffuse materials.
2. Create a plane with an emission material and position it above the other objects.
3. Set up two render layers, one for composite and one for shadow pass.
4. Render scene and connect a viewer to the shadow pass output in the compositor.
5. Black image is seen.
Interestingly, the AO pass does render correctly. As mentioned above, this happens regardless of the render device (CPU or GPU).
If there is a light in the scene then the shadow pass is rendered but it only shows the shadow cast by the light.
Could it be related to this closed bug #33984? (http://projects.blender.org/tracker/?func=detail&atid=498&aid=33984&group_id=9). Although that was apparently constrained to CUDA renders.
--- Operating System, Graphics card ---
It's actually working as intended now, the shadow pass does not contain any shadow from the environment or emitting objects. As far as I know emitting objects were never included, and the environment only happened when multiple importance sampling / sample as lamp was enabled, which was a bug.
Thanks for the clarification Brecht. That was a useful bug!
Without this, what is the recommended way of extracting shadow information for VFX compositing purposes when the only illumination in the scene is from an equirectangular HDR panorama?
A specific example is compositing an object over a camera tracked plate and casting realistic shadows. In other words, what is the proper way to make a shadow catcher material with cycles and environment lighting now?
I noticed that I can get a shadow pass again on 2.66a with only environment lighting. Is this a regression or is it expected now for shadow passes to work with environment lighting?
Brecht & Company:
I just want to quickly poke any developers on this issue. I'm surprised that the fix isn't requested more regularly, because it seems that virtually all compositing uses environmental lighting, and yet you always have to set up dummy lights for the shadows. So this issue is both (a) confusing when the user first runs into it and (b) compromises the realism of many composites.
Still, beggars can't be choosers, and I'm grateful for things as they exist right now. Thanks as always.
I add myself to the queue. I'm slowly migrating from 3DS Max to Blender and in my projects I use a lot of these "shadow catchers" not just on regular planes but on more complex structures too. I use them to integrate 3D object into real pictures, not just panoramas. I was able to get something workable with compositing and rendering layers but it is a bit convoluted. A "shadow pass" working with emission material would be a good solution, even if a proper "shadow catcher" material would be preferable, especially considering all the camera tracking features that Blender seems to offer.
Lack of possibility to get shadow pass taking into account emmissive meshes is pretty important. I tried to bake shadows on a plane in Cycles (just with camera) and finally I did it with point lights, but I had to spend very much time investigating the problem. It's really unobvious. Please implement what you said sometime. Thank you very much.
Ah, OK. Just curious, how are those items usually prioritized?
And thanks for all your great work with Cycles and Blender. It's amazing how far along Cycles has come in such a short time and the beautiful things people are doing with it.
Looking forward to the things on that list in the future!
It seems to me that one could get the same result through compositing, having one layer "WithShadows", another layer "WithoutShadows" where the shadow-casting object does not belong, then using a subtract node in the compositor to isolate what the shadows have altered. Isn't it ?
I don't think so, the issue is that there is "no" shadows being created by environment lighting so whether you have a With Shadows layer or not, you'll get no shadows....without adding lights to simulate the environment shadows. Unless I am misunderstanding you.
You can certainly do what PatB suggests (I've done it, I'll try to share a node tree here) but it requires creating additional render layers, etc. You don't get a Shadow Pass, you just render a Composite pass WITH shadows and "shadow catcher" object without, then subtract one from the other. You can then invert the resulting matte and use it as a shadow pass.
It would just be nicer and cleaner to have a Shadow Pass from the environment lighting. You can then just multiply the AO and Shadow passes onto the BG, under the object.
@Matt Outlaw (outlaw3d): note that the suggested compositing is not using the "shadow pass", just the regular image output. Subtracting image with shadows from image without shadows (actually without the objects that cast the shadows) has the effect that everything that was unchanged by shadows is cancelled out, leaving the shadows isolated.
This assumes that you can distinguish between the shadow-casting objects and the shadow-receiving objects, using separate layers. It is definitely just a workaround, not a long term solution.
I created the following example of shadow catcher using the compositor few months ago.
Open the blender file and press F12. It will generate all the layers including the shadow pass.
With some modification you can change the color of the shadows. Hope it helps.
Just popping by to see if any consideration of this had been made?
Does the development team still look at the Dev:2.6 Todo list (or is there a new one)?
I too would like to ask for the emission light in Cycles to contribute to the shadow pass. The current work around to subtract a "clean pass" from a "pass with shadows" will work but isn't ideal, as the intensity of the shadow will be dependent on the diffuse shading). For compositing over a wide range of plates, it would be better to have the shadows completely separated from the diffuse shading for max accuracy and range in compositing. It will also save on render time as I would not need to generate a clean pass. Thanks.
I landed here as I thought the shadow pass is buggy. It's black when I only have light emitters in my scene.
If you think the shadow pass works as expected Brecht, then maybe another shadow pass for light emitters would be worth adding.