Shading an object with a semi-transparent object in front of it.

I have a good idea in mind for shading an object with a semi-transparent object in front of it. Take a look at this image as an illustration:


The only issue with this technique that I’m having is that I can’t figure out how to make the semi-transparent black Plane invisible while still darkening the Cube behind it.

I’ve tried a few different things, Such as putting the Plane on a different layer and playing with Render settings, but I can’t achieve the affect that I want. I’ve tried fiddling with all of the material settings and can’t get it working there either.

This would be such a boon for me if I could get it working properly. I have several ideas in mind of how I’d wish to implement it for character models.

Do you want the plane just to affect the cube or any objectgroup, or everything except the sky?
Is it Blender Render, Cycles, OpenGL or any other engine?

To keep it simple, could you just show me how to make it affect the Cube? I’m certain that once I’m taught that I can figure out how to do a “only affects objects in this group” type of thing.

Blender Render.

I don’t think there’s a method specific for that, so render two layers, one of the plane and the other of the cube, and mix everything in the compositor. (you may want to multiply the alpha channel from both layers, and use that as the mask for your texturing)

That doesn’t work. That method will disregard the positioning of the Plane and darken the Cube even if it’s behind it.

The closest thing I’ve found to a solution is using a Chroma Key node to delete the part of the rectangle Plane that I don’t want to see and just leaving how it has affected the Cube, but this isn’t good either as it makes me constrained to what colors I’m allowed to use and am currently reduced to shading only in bright green

Well, teal is a good compromise. As long as I don’t use teal.

post deleted*

You need to mask the layer with the box from the layer with the plane.
Here’s the setup I was talking about.

May I ask you for what do you need this… I mean, is there some particular reason for using this method?