PDA

View Full Version : Label Passe in Maya2009


achoury
10-31-2008, 09:45 AM
hi

after more test i found a solution on how label passe work in maya 2009
here is the label passe

http://img134.imageshack.us/img134/1336/labelbeautywj3.jpg (http://imageshack.us)
http://img134.imageshack.us/img134/labelbeautywj3.jpg/1/w640.png (http://g.imageshack.us/img134/labelbeautywj3.jpg/1/)

Create a integer miLabel for all the object present in the scene
assigne a unique shader for all the object

my sphere has miLabel set to 128 (no reason just a number)
cube 10
cone 11
plan 20

creat one render layer and one customLabel passes
each object must have one node writeToLabelBuffer
so create 04 node writeToLabelBuffer
and connect teh outColor to evaluationPassThrough

connectAttr -f lambert2.outColor writeToLabelBuffer1.evaluationPassThrough;
connectAttr -f lambert2.outColor writeToLabelBuffer2.evaluationPassThrough;
connectAttr -f lambert2.outColor writeToLabelBuffer3.evaluationPassThrough;
connectAttr -f lambert2.outColor writeToLabelBuffer4.evaluationPassThrough;


http://img505.imageshack.us/img505/2568/shaderbw2.jpg (http://imageshack.us)
http://img505.imageshack.us/img505/shaderbw2.jpg/1/w578.png (http://g.imageshack.us/img505/shaderbw2.jpg/1/)

assinge the customLabel passe created in render passe layer to each node writeToLabelBuffer in Frame Buffer Options->CustomLabelPass
and put the value for the Label like so

http://img356.imageshack.us/img356/2456/samelabelbo9.jpg (http://imageshack.us)
http://img356.imageshack.us/img356/samelabelbo9.jpg/1/w800.png (http://g.imageshack.us/img356/samelabelbo9.jpg/1/)

Put the the Data Type: Label(Integer)1x32Bit in Mental ray Framebuffer

http://img356.imageshack.us/img356/1240/framebufferkh3.jpg (http://imageshack.us)
http://img356.imageshack.us/img356/framebufferkh3.jpg/1/w514.png (http://g.imageshack.us/img356/framebufferkh3.jpg/1/)

again when you render you get the label rendered in beauty passe folder rather then the label passe! (don't ask i don't know why)

hope someone can give the correct way to do it


Edit: if you change Data Type to Coverage(Float) 1X32 Bit you get the coverage passe
Always rendered in beauty passes folder

http://img136.imageshack.us/img136/7158/coveragemi3.jpg (http://imageshack.us)
http://img136.imageshack.us/img136/coveragemi3.jpg/1/w640.png (http://g.imageshack.us/img136/coveragemi3.jpg/1/)

/Rachid

joie
10-31-2008, 10:47 AM
Hi rachid.

Could you point me to some place where I can read about what is and how to use in comp a coverage pass?.

Thank's for the info and the short tutorial, is highly appreciated. :)

achoury
10-31-2008, 11:37 AM
Hi rachid.
Could you point me to some place where I can read about what is and how to use in comp a coverage pass?.
Thank's for the info and the short tutorial, is highly appreciated. :)

hi
I'm not sure but do a search in pigsfly forum (http://www.pigsfly.com) there are a lot thread about ID, Depth, Label and Coverage with fusion
nb:you must register in that forum

/rachid

Gozer
10-31-2008, 12:28 PM
Great tutorial there, finally some answers this eluding problem. The only thing i wonder is if you change the framebuffer to label / coverage, that is done on a per pass level, meaning you can't render these passes at the same time as your other passes (I.e color, reflect, spec etc) since those passes would require an rgb framebuffer and layer override only works on per render layer not per pass. Old style way with ctrl_buffers you where able to hook up multiple framebuffer outputs (each output being .label .coverage .tif etc). Not sure if and how to do the same with this new setup, is it even doable or is it another design flaw to be added in later version of maya?

achoury
10-31-2008, 02:45 PM
Great tutorial there, finally some answers this eluding problem. The only thing i wonder is if you change the framebuffer to label / coverage, that is done on a per pass level, meaning you can't render these passes at the same time as your other passes (I.e color, reflect, spec etc) since those passes would require an rgb framebuffer and layer override only works on per render layer not per pass. Old style way with ctrl_buffers you where able to hook up multiple framebuffer outputs (each output being .label .coverage .tif etc). Not sure if and how to do the same with this new setup, is it even doable or is it another design flaw to be added in later version of maya?

hi
Thank you for asking, because it's very simple now and no need to create writeToLabelBuffer to get label passe or Coverage pass
you can get all the passes you want:
beauty, Indirect, reflection, with Coverage pass or Label Pass etc...

First add a miLabel attribute to all your object
choose Coverage [float] 1X 32 Bit in Framebuffer Data Type then right clik and choose Create Layer Override
when you render you get all the passes and the coverage passe rendered in MasterBeauty

Now if you choose label[Integer] 1X32 Bit with Create Layer Override On you get also all the passes with label passe rendered in MasterBeauty
voilą!
/rachid

achoury
10-31-2008, 02:58 PM
Hi rachid.
Could you point me to some place where I can read about what is and how to use in comp a coverage pass?.
Thank's for the info and the short tutorial, is highly appreciated. :)

hi
I found a video tutorial Using mental ray label pass (http://www.digitaltutors.com/store/video.php?vid=1449)

http://img207.imageshack.us/img207/8761/digitalvr6.jpg (http://imageshack.us)
http://img207.imageshack.us/img207/digitalvr6.jpg/1/w782.png (http://g.imageshack.us/img207/digitalvr6.jpg/1/)

Hope this help

/Rachid

misterJoj
10-31-2008, 06:43 PM
this tutorial may help : http://www.sigillarium.com/articles/labelExtractor_e.html

Ash-Man
10-31-2008, 06:43 PM
Richard, why do you need the label number?

achoury
10-31-2008, 08:47 PM
Richard, why do you need the label number?

who is Richard ?!!!
my name is Rachid and achoury is just a nickname, anyway the integer number in miLabel attribute is for computing color and coverage passes, this is done by mental ray renderer.

achoury
10-31-2008, 08:52 PM
this tutorial may help : http://www.sigillarium.com/articles/labelExtractor_e.html

yes that was my source for doing the label and coverage in Maya2009
thanks again to sigillarium for his nice article
/rachid

may99
11-03-2008, 04:28 PM
I'm trying to develop little tool to automate this process but it seems that i am stucked:

this is how i do it:

1. select object add attribute called "miLabel"
2. then i create new pass CustomLablel and render

then mr dives me error "// Error: (mental ray) : OpenEXR: Image channel name cannot be an empty string."

seems like no data was generated :(

Could you please point me in right direction.... maybe simple step by step tutorial

Thank you in advance

MM

achoury
11-03-2008, 05:47 PM
Hi
OpenExr need a minimum 04 channel (channelA channelB channelG channelR) to output in exr format and miLabel has only one channel! for that reason you can't output milabel and coverage to .exr format (maybe I'm wrong! )
anyway choose another format iff, png hdr tga etc..to Output miLabel and coverage.

/rachid

may99
11-03-2008, 06:22 PM
thanx for fast reply

i am probably missing something
the rendered image is black no matter what file format i use:(

achoury
11-03-2008, 07:10 PM
thanx for fast reply

i am probably missing something
the rendered image is black no matter what file format i use:(

I've attached a scene file describing the 02 methods take a look, just hit render and like a sad in my previous post the label pass and the coverage pass are rendered in beauty passe folder rather then the label passe folder !

hope this help

/rachid

may99
11-03-2008, 07:20 PM
thank you man

slipknot66
11-06-2008, 07:39 PM
hi
Thank you for asking, because it's very simple now and no need to create writeToLabelBuffer to get label passe or Coverage pass
you can get all the passes you want:
beauty, Indirect, reflection, with Coverage pass or Label Pass etc...

First add a miLabel attribute to all your object
choose Coverage [float] 1X 32 Bit in Framebuffer Data Type then right clik and choose Create Layer Override
when you render you get all the passes and the coverage passe rendered in MasterBeauty

Now if you choose label[Integer] 1X32 Bit with Create Layer Override On you get also all the passes with label passe rendered in MasterBeauty
voilą!
/rachid

Another way to avoid the use of any Override in the framebuffer, is just set the output pass within the camera.
Just setup your passes (difuse, especular etc) in the passes tab of the render settings.Then open the camera attribute editor, for the camera you want to render, and then under the mental ray tab, Output Shaders, and create a new pass there.Then choose a file format, and the pass you want.Its almost the same thing you suggested but in this case you dont need to use any override.

achoury
11-07-2008, 07:42 AM
Another way to avoid the use of any Override in the framebuffer, is just set the output pass within the camera.
Just setup your passes (difuse, especular etc) in the passes tab of the render settings.Then open the camera attribute editor, for the camera you want to render, and then under the mental ray tab, Output Shaders, and create a new pass there.Then choose a file format, and the pass you want.Its almost the same thing you suggested but in this case you dont need to use any override.

hi
thank you for looking here, so now we have many ways to output the "special" channel in mental ray
/rachid

mustique
11-07-2008, 03:22 PM
THx guys for the all the info.

Getting the label and coverage passes in the masterbeauty, rather than in their own folders
is painfull but better than nothing. Also I too would like to know if anybody here had success with these passes in multichannel EXR files.

As things stand, rendering objects in a seperate render layer with surface shaders and hardware renderer assigned, seems to be much less of a hassle.

achoury
11-07-2008, 03:49 PM
THx guys for the all the info.

Getting the label and coverage passes in the masterbeauty, rather than in their own folders
is painfull but better than nothing. Also I too would like to know if anybody here had success with these passes in multichannel EXR files.
As things stand, rendering objects in a seperate render layer with surface shaders and hardware renderer assigned, seems to be much less of a hassle.

If you create your special pass (label, normal, coverage etc..) in camera Output Shader like slipknot66 mentioned you get your passes in the same folder (layer 1)


Another way to avoid the use of any Override in the framebuffer, is just set the output pass within the camera.
Just setup your passes (difuse, especular etc) in the passes tab of the render settings.Then open the camera attribute editor, for the camera you want to render, and then under the mental ray tab, Output Shaders, and create a new pass there.Then choose a file format, and the pass you want.Its almost the same thing you suggested but in this case you dont need to use any override.

with Multichannel EXR it render all the pass but noting in label or coverage pass and sometimes Maya crash for mystery reason!
/rachid

mustique
11-07-2008, 04:51 PM
thx achoury

Somehow industry standart opensource format's never get the deserved attention at AD,
but let's hope the exr output bug for these passes will get ironed out soon as well.

jasonhuang1115
12-02-2008, 03:16 AM
Hi, Rachid and all,

Anyone has idea of how to use generated Label ID pass as mask in Nuke?

Ammarkk
12-02-2008, 09:17 AM
Hi Rachid, this is nice topic and very interesting, thanks man.

cavemen
12-04-2008, 03:18 PM
It is wonderful to see this finally in maya 2009
however does any one of you guys know how to integrate this in nuke ?
have tried in DF and shake works gr8 but where i am working we are using nuke and have no idea how to use these in this amazing software .

It would be a gr8 help if anyone can ease out my problem ..
thanks all

Eshta
02-10-2009, 03:22 PM
Hello everyone
I was trying the same thing and I still get black images
even with the sample files in the thread, I get black images
here is my test
can someone tell me what I'm doing wrong
thanks

achoury
02-10-2009, 07:57 PM
Hello everyone
I was trying the same thing and I still get black images
even with the sample files in the thread, I get black images
here is my test
can someone tell me what I'm doing wrong
thanks

hi
did you read the post above carefully?
any way, here is your scene corrected

/rachid

Eshta
02-10-2009, 11:52 PM
Thanks Rachid.
I see My problem now
cheers

AlucardCg
02-11-2009, 03:23 AM
Hi achoury:

I've seen your method to creat the label pass which is very good and useful ,however, i was wondered how to control the label color ? for example ,if i want to give some other colors to the labels color of the objects ,how to do ? Hope you could explain this point,thanks!

achoury
02-11-2009, 11:31 AM
Hi achoury:

I've seen your method to creat the label pass which is very good and useful ,however, i was wondered how to control the label color ? for example ,if i want to give some other colors to the labels color of the objects ,how to do ? Hope you could explain this point,thanks!

Hi
I don't have a table for label color, but you can do some test with a few objects with miLabel assigned and see what color return
for my test, Ive assigned numbers 1 to 20 and here is result

http://www.postmyimage.com/images/imagesl3F51738.jpg

so
1 = red
2 = green
3= yellow
4 = blue
5 = cyan
etc..

/rachid

Ash-Man
02-11-2009, 04:29 PM
One other appraoch would be using the "Custom Depth" as the drive for the object ID.

for example
assign a custom depth node for each material > give the "depth" diffrent value for each one > thus having differnt colors in that pass
just an idea..

AlucardCg
02-12-2009, 03:35 AM
achoury: thank you for your reply:thumbsup:

DirkHei
03-17-2009, 02:22 PM
Hi,
thanks. Great tutorial. I got it working with After Effects.

The problem I have now, is that the label Image seems to have no AntiAliasing, no matter which settings i choose.

Any ideas?

Thanks

achoury
03-17-2009, 04:08 PM
Hi,
thanks. Great tutorial. I got it working with After Effects.

The problem I have now, is that the label Image seems to have no AntiAliasing, no matter which settings i choose.

Any ideas?
Thanks
Hi
yes you are right, but you can correct the pb by using MatteControl node in Fusion to remove the jagged edge and give it a little bit of blur
in After effect there is a filter called matte choker or something like that to shrink and blur the jagged edge as in Fusion it's not a perfect solution but do the job!
/rachid