Jump to content

Object Mask passes


Recommended Posts

  • 3 years later...

Hi guys! Very helpful post, thank you.

I'd like to apply a similar technique to particles - i.e. color them R, G or B depending on their Pop_Stream. But I'd like that to be an extra image plane. I tried the above technique which works great for objects, but not particles?

Link to comment
Share on other sites

It should work fine, just use a bind export in you shader exporting to something like "rgbMatte" and hook up your colour attrib (dosnet have to be named colour, but must be what attrib name you have on your particles). Just make sure you have rgbMatte as one of your AOVs. The biggest problems you will come across are not matching up the names and data types properly, then you get black AOVs.

Link to comment
Share on other sites

Well even if you "dont" use a shader, one is assigned by default, your colour just overides the diffuse colour of that shader. You might be able get something out of the standard set but its easier to assign a shader and set your AOV outputs inside. I dont think you can get a Cd export by default.... could be wrong

Link to comment
Share on other sites

  • 10 months later...
On 28/04/2013 at 3:22 PM, anim said:

just create export parameter in your shader with name you like for example object_id (and add it to image planes in mantra)

then in each of your object create attribute called the same with the same type and assign different value per object

what works best is to create Vector4 attribute since then you can have 4 different object groups (red, green, blue, alpha) so {1,0,0,0}, {0,1,0,0}, etc

in that case you'll get perfect antialiasing between them as you can separate it per channel in comp

to create more object groups just add another variable export like object_id2 etc

you can of course export just float variable and assign values like 0, 1, 2, ..., but that will create problems in antialiasing wheire any 2 non neighbour ids overlap (like 0 and 3, since interpolated value will go through 1 and 2)

11

The object ID's are not showing in my pass, I created an attribute, added the parameter in the Principled shader and set the image plane for export. Do you have any idea what am I missing?

obj_ID(notWorking).hipnc

Edited by crispyastrologer
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...