Which COP to use for z-masking

   5635   7   1
User Avatar
Member
301 posts
Joined: July 2005
Offline
Hi,

I have created two images Torus.rat and Cylinder.rat (I understand that the RAT format has depth information by default) using separate ROP

The cylinder sits inside the ring of the torus.

I have rendered them out separately.

I would like to use the depth information in Torus.rat to mask out the picture Cylinder.rat such that only the visible part of the cylinder are shown.

What COP should I use to achieve this? I have had a look at the Compositing manual but could not find a similar example showing one how to go about achieving this.

Cheers
Nicholas Yue
User Avatar
Member
4140 posts
Joined: July 2005
Offline
AFAIK rat format doesn't contain depth info by default - you need to put a layer in there with that. If it does, it does it badly because it doesn't show up as a layer. Also, if you want to render the layer directly to the rgba image in one step, you need to use .pic format. In your Mantra ROP, go to Deep Rasters and add one of the preset Pz layers and render to *.pic(If you render to rat, it will output a file called Pz ).

When you render this will be embedded and you can feed it into the zcomp COP. I've had some troubles getting that to behave the way I'd like tho. Fiddle with it.

Cheers,

J.C.
John Coldrick
User Avatar
Member
7710 posts
Joined: July 2005
Online
Try the ZComp COP.
User Avatar
Member
301 posts
Joined: July 2005
Offline
JColdrick
AFAIK rat format doesn't contain depth info by default - you need to put a layer in there with that. If it does, it does it badly because it doesn't show up as a layer. Also, if you want to render the layer directly to the rgba image in one step, you need to use .pic format. In your Mantra ROP, go to Deep Rasters and add one of the preset Pz layers and render to *.pic(If you render to rat, it will output a file called Pz ).

The embedded file has a reference to a z component which is stored in an external file but that file does not gets created.

Is that because I am using the Apprentice version (6.1.208)

JColdrick
When you render this will be embedded and you can feed it into the zcomp COP. I've had some troubles getting that to behave the way I'd like tho. Fiddle with it.

I have tried fiddling but it seems that the z-component is missing from the file.

see

http://members.westnet.com.au/tmyue/images/zcomp.jpg [members.westnet.com.au]
Nicholas Yue
User Avatar
Member
7710 posts
Joined: July 2005
Online
Works fine for me. Did you render out both files including the Pz deep raster plane?
User Avatar
Member
301 posts
Joined: July 2005
Offline
edward
Works fine for me. Did you render out both files including the Pz deep raster plane?

I did select Pz

http://members.westnet.com.au/tmyue/images/DeepRaster.jpg [members.westnet.com.au]

After that, I just hit Render in the ROP.

Do I have to setup something else to enable deep raster to work?

Cheers
Nicholas Yue
User Avatar
Member
4140 posts
Joined: July 2005
Offline
Yah, looks like you're mixing methods there - either render it right into the image or render it out as a separate file and pull it in later(you're inferring this can't be done with the non-commercial - wouldn't know that). What you need to do is render to .pic format, and in your ROP remove that reference to a path/filename and replace it with, well, I'm not near houdini but I think it's Pz again, or perhaps “D” - it doesn't matter - that's just the name of the layer. Try it on the next layer down to find the default. When Houdini doesn't see a path or extension and you're rendering .pic, it assumes you want it embedded into the main image.

Once that's done, do an iinfo or MMB on the rendered image and you should see a “D” layer there along with rgba - that's the one you want. That entire rgbaD image gets fed into the FG input(watch this - I think this COPs top two connectors are flipped according to typical style when I tried this yesterday - check this) and zcomp will watch for a depth layer…

Cheers,

J.C.
John Coldrick
User Avatar
Member
301 posts
Joined: July 2005
Offline
Thanks John,

The Pz thing solved the problem, I now have two PIC with depth information call others_0001.pic and ball_0001.pic.

When I use the zcomp, I see the content of both images, what I wanted to achieve was to use the z-depth information in others_0001.pic to mask out the ball_0001.pic so that only those part in ball_0001.pic that is not being block (by things that are nearer in others_0001.pic) are showing through (and nothing else) as I need to apply a Blur COP to the result.

I than need to composite the result back with the others_0001.pic for the final image.

Any suggestions?

Cheers
Nicholas Yue
  • Quick Links