How can I create an invisibility cloak? It should be an invisible object which causes other specified objects to become invisible when it covers those objects.
After reading Leon Cheung's answer, I've redone my solution:
Say you have this setup
and you want to make the plane into an invisibility cloak that affects only the red monkey.
First, make the background transparent (see here for help).
For Blender Render, select the plane, and under the Materials tab of Properties window, enable
Mask and set
Alpha to zero:
For Cycles Render, select the plane and set its material to
For both Blender and Cycles Render, you create two render layers: one with the invisibility cloak and objects affected by it, and one with the normal, unaffected objects.
Then create this node setup:
and the result is:
Your own solution seems nice enough. For Cycles, I just want to share with a simple way, which needs just two renderlayers and less nodes:
- For the cloak object, you can use Holdout shader.
- For cases related to Z, you can simply add a Z Combine node (as you did in your own answer). Furthermore, Alpha Over brings more control on Alpha. Anyway, it could be one solution for Cycles. :)