3
$\begingroup$

Imagine a scene with a camera facing a background plane, with suzanne in between partially obscuring some of the background plane. I'd like to do a 'project from view' from the perspective of the camera and see a suzanne shaped hole in whatever image was projected onto the background. Both meshes are a single object.

As I have my scene set up at the moment, the image being projected hits both the monkey and background.

$\endgroup$
3
$\begingroup$

If I understand correctly, what you are looking for is to use an object as a mask. There are many ways to do it. Here are some:

In cycles, you can use holdout as a material on the monkey to get you what you want.

enter image description here

Rendered image

enter image description here

enter image description here

Also if you use a material index on the monkey's material you can substract the object from the background using the compositor.

The plane and the monkey have different materials.

enter image description here

On the monkey's material change the pass index to 1.

enter image description here

Enable material index on your render layers.

enter image description here

In the compositor use the IndexMA as alpha for your image.

enter image description here

To get this:

enter image description here

In Blender internal you can set the material of the monkey to be used as mask.

enter image description here enter image description here enter image description here

$\endgroup$
  • $\begingroup$ Thankyou for your answer. What I was hoping for is some combination of material nodes, possibly involving the light path or texture coordinate node. Whilst your method would work for this simple example, in my actual scene another camera is acting as a projector of this image with the UV project modifier on the plane/monkey object. Making masks/holdouts/clever compositing tricks unusable. $\endgroup$ – Joe Dec 8 '14 at 22:32
  • $\begingroup$ @Joe could you upload your file? I just made a test with the UV project modifier and one object (plane and monkey joined in a single object, the monkey with holdout material and an empty as UV projector) and it works just fine. i.stack.imgur.com/sdiqp.png $\endgroup$ – cegaton Dec 8 '14 at 23:50
  • $\begingroup$ Perhaps I'm not explaining too well. Check out the .blend in my question. Thanks. $\endgroup$ – Joe Dec 9 '14 at 2:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.