Shadow Groups?

Hi, I was doing some matchmoving and was wondering if it was possible to have shadow groups in Blender. It might be called something different, but I know very little about materials and lighting with Blender.

By shadow groups I mean having one object cast shadows on an object within one group, but not another object in a different group.
For example, I want a cube not to cast a shadow on the plane it is resting on, but I want it to cast a shadow on a nearby ball. Then the ball will cast a shadow on the plane.

Thanks in advance for any help.
I’m using 2.49b

in the lamp buttons, once you set you lamp for ray shadow, there are some options. one is a button labelled ‘layers’ which i believe is what you are looking for. I think there is also a way of doing it with groups but I can’t recall how exactly.

Thank you for the quick reply and enlightening me with the “layers” button, but although the option works, it does not work in the way I require it to.
The “layers” button makes it so only objects in the same layer as the lamp casts shadows.
No matter how I arrange the objects in the layers, the objects will still cast shadows on everything around it.
What I need is for the object to selectively cast shadows on certain objects, but not others.
i.e. cube casts on ball, but not on plane. Ball casts on plane
Sorry if I did not explain this properly in the original post.

I just noticed there are actually two layer buttons. perhaps if you combined them. I am still sure there is a way to do this involving groups that I am going to check into. and nodes are another possibility.
(edit) here’s a little explanation of the composite node system

So far I can do it using 3 duplicates of 1 lamp, with slight adjustments.

In your example:

  • move the plane to layer 1
  • move the sphere to layer 1+2
  • move the cube to layer 2

Create 3 duplicates of a lamp, and change to the following:

  • move lamp 1 to layer 1+2. Disable casting of shadow (‘No Shadow’)
  • move lamp 2 to layer 1. Enable ‘This Layer Only’ (under Lamp tab, not Shadow tab) and ‘Only Shadow’
  • move lamp 3 to layer 2. Enable ‘This Layer Only’ (under Lamp tab, not Shadow tab) and ‘Only Shadow’

that’s it.

EDIT: I didn’t use the ‘This Layer Only’ under the Shadow tab. Perhaps an easier might be possible, but so far can’t think of any.

Do’h, got an easier setup now. Only 2 lamps needed.

Move the objects as described earlier.

Create 2 duplicates of a lamp:
Lamp 1 goes to layer 1. Under Shadow tab enable ‘This Layer Only’
Lamp 2 goes to layer 2. Enable ‘This Layer Only’ under Lamp tab AND Shadow tab. Also enable ‘Only Shadow’

While I was reading through your solution I thought it would work, but when I tried it in blender it didn’t…
Darn blender.
Thanks anyways.

I’m fairly sure there is a way to do this using nodes but it’s pretty late here so I’m just going find how them nodes work and see if I can find a solution through 'em tomorrow.

While I was reading through your solution I thought it would work, but when I tried it in blender it didn’t…

Not sure if you mean my last solution, but that one does work. Every step has to be followed exactly, otherwise you won’t get the desired result.

I did your instructions exactly. I even tried rendering just layer one, then just layer two, then them both at the same time but the objects are still casting shadows on every other object. I did get my matchmove done though, I decided I would just ignore the unwanted shadows for now. They don’t impact the realism too greatly.

I can put a link to it here later. Gotta go to class (:

I’m so stupid, I forgot that I had ambient occlusion turned on so what I was seeing being cast by the cube on the plane was not shadows, it was the AO. Thank you Sago, your solution does work. Unfortunately I have a new problem:
How do I get ambient occlusion to selectively show? I’m guessing there’s no real easy answer.


I guess you have to go into compositing for this one. Every object in it’s own render layer, from which you can seperate every pass you wish (shadow, AO, diffuse,…) and composite all back together.

Ok, so here’s the end result of my matchmove. It was more of a test really. When I figure out how to do stuff with Mocha, I’ll replace the screen on the phone.
I used 3 programs for this:

  • Boujou for the tracking
  • Blender for the objects
  • After Effects CS5 just to smush it all together

Feedback is welcome.

The “Layer Lamps” feature (by any other name…) is a property of a Lamp which dictates which layers it “sees.” Only objects within those layers will be considered in the calculations for that particular lamp.

As far as I am aware, there is no comparable feature at this time that relates to (object or vertex) “groups,” although I’m sure you are welcome to implement it … “welcome to the world of open-source software … is it done yet?”

Nodes, of course, can also come into play, because they allow you to construct quite arbitrary data-flow paths to dictate precisely how your final image is to be constructed.