CGTalk > Software > Autodesk Maya > Maya Rendering
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 03-31-2004, 01:08 PM   #1
yinako
Lord of the posts
 
yinako's Avatar
portfolio
David Ying
Art Director
Red Pixy
Sydney, Australia
 
Join Date: Dec 2001
Posts: 782
Send a message via AIM to yinako Send a message via MSN to yinako
Maya Z-depth vs Mental Ray Z-depth

huh, why is depth channel rendered in Maya renderer different from Mental ray?

same scene, no facy stuff, just switched renderes and the result depth is different, what gives?

How am I suppose to composite images rendered from Maya to images rendered in MR if they have different depth?!!

I tried to composite pfx to Iff rendered from MR, and Pfx gets blocked behind the object.
__________________
"Story in a game is like story in a porn movie. It's expected to be there, but it's not that important." - John Carmack
 
Old 04-01-2004, 10:21 AM   #2
Jackdeth
Master Oppressor
 
Jackdeth's Avatar
Colin Strause
Director
Hydraulx
Santa Monica, USA
 
Join Date: Apr 2003
Posts: 2,477
Heres a tip, don't use Z depth renders. They don't have anti-aliasing so you will never get good comps. Use enviorment fog or a ramp projected through your scene instead.

Much cleaner, and you have much more control.
 
Old 04-04-2004, 11:31 PM   #3
egoman
VFX Supervisor
 
egoman's Avatar
portfolio
Andreas Bravin Karlsson
VFX Artist & Supervisor
stockholm, Sweden
 
Join Date: Jun 2003
Posts: 13
Common misconception

It's a common misconception that depth maps should be anti-aliased. This is of course not the case as it would mean that the edge of a foreground object approaches the distance of its backdrop. It's not apparent to me how this very correct behavior could introduce any kind of artifact, but if it did the only solution would be to up the resolution of your render.
Using Mayas built-in fogs, dof, and similar effects would of course not help either as these are post effects making use of exactly the same depth map as otherwise output.

To answer the original question; The problem is a result of Mayas use of inverted distance values for depht maps (-1/z), resulting in 0 representing infinite distance and increasing negative numbers being closer to the camera. With mental-ray, on the other hand, a straight z-map is used (0 is near and distance is a positive float).
Both renderers output the same depth information, they just use a different range of numbers to represent distance. A remapping will be necessary to use both of them in the same compositing system.

If you find this to be old news, your problem might depend on the clipping planes. The Maya Software Renderer will make use of the Auto Render Clip Plane setting for the camera and thereby calculate these values automatically at rendertime, but mental-ray completely disregards this setting and will use what ever clipping plane values might be set. Not noting this could result in the renderers using different far/near ranges, so make sure this option is turned off.


Andreas Karlsson
Ego Studios
 
Old 04-05-2004, 05:20 AM   #4
yinako
Lord of the posts
 
yinako's Avatar
portfolio
David Ying
Art Director
Red Pixy
Sydney, Australia
 
Join Date: Dec 2001
Posts: 782
Send a message via AIM to yinako Send a message via MSN to yinako
Heres are the ranges

Mental ray Z range: [6.95845 , 8.73089]
Maya Render Z range: [-0.147297 , -0.0001]

Like the guy said distance are inverted, but turning off auto render clip plane made no difference to the z depth.

Also fcheck doesn't save the red channel when converting z depth to a standard format like tif/tga.
Anyway a way to normalise the two would be nice. I'm not a compositor so I don't know much, how would I go about doing it?
__________________
"Story in a game is like story in a porn movie. It's expected to be there, but it's not that important." - John Carmack
 
Old 04-05-2004, 07:40 AM   #5
jlmakes
Expert
 
jlmakes's Avatar
portfolio
Julian Lloyd
Independent
Oakland, USA
 
Join Date: Feb 2003
Posts: 1,455
i never got Z-depth to work, maybe it was the file types, but After Effects never properly interpretted my images.

but what did you mean by use ramps or env fog? help me!
__________________
Designer ✦ Developer
 
Old 04-05-2004, 09:45 AM   #6
egoman
VFX Supervisor
 
egoman's Avatar
portfolio
Andreas Bravin Karlsson
VFX Artist & Supervisor
stockholm, Sweden
 
Join Date: Jun 2003
Posts: 13
I did not mean that uncecking Auto Render Clip Plane would change the fact that Maya inverts the z-map, just that it could introduce a second problem as mental-ray might clip object that Maya would not. There is however something wrong with your numbers; -0.147297 should correspond to a mental-ray value of 6,7890045, and -0,0001 is a really great distance, much greater than 8.73089. I'm afraid I don't really know what's causing this if not the clipping planes.
To be of even less assistance I must tell you that using Fcheck to convert depth maps is not a good idea as it produces an 8-bit rgb image instead of the 32-bit singe channel image you'd want. This is also what you would get from following thew advice of Jackdeth, and the data-loss is, in most cases, unacceptable. If you should choose to go down that road anyway, I could offer some help with the problems you'll encounter as soon as I get back from work.

When it comes to After Effects, I'm not an expert, but it seems logical that it would interpret the channel correctly as long as you define the proper range. If this isn't possible, then this should be a common problem indeed and I'm convinced that there are plenty of plug-ins which would rectify the situation.
The reason I cannot be of more help here is that I always use Shake to normalize all depth maps as part of the pipeline, no matter what system they will be used for, and therefore these issues have never arisen.


Andreas Karlsson
Ego Studios
 
Old 04-05-2004, 10:09 AM   #7
Jackdeth
Master Oppressor
 
Jackdeth's Avatar
Colin Strause
Director
Hydraulx
Santa Monica, USA
 
Join Date: Apr 2003
Posts: 2,477
Re: Common misconception

Quote:
Originally posted by egoman
It's a common misconception that depth maps should be anti-aliased. This is of course not the case as it would mean that the edge of a foreground object approaches the distance of its backdrop. It's not apparent to me how this very correct behavior could introduce any kind of artifact, but if it did the only solution would be to up the resolution of your render.

Andreas Karlsson
Ego Studios


To not have a depth matte file match up perfectly with you render image would cause edge roughness and black outlines. Its simple math to mult images together, but everything needs to be perfectly aligned to work smoothly. What is AA? Its a sampling of a large area that is then scaled down. That pixel can be a blend of the foreground object, as well as the background ojects. Now, if you try to use Maya's lame depth matte, you will find that the depth file can only store ONE depth value per pixel. This means that it can be only the foreground OR the background object's depth stored. This will cause a staircasing jaggy issue on you object's edges when trying to comp a layer in between them.

Render out using white enviorment fog with all black shaders, or project a ramp on a surface shader through all of the objects are cleaner meathods becuase it gives your "super depth pass" with the same AA as your main render. This means all of your plates line up perfectly, allowing you to have nice looking comps.

Last edited by Jackdeth : 04-05-2004 at 10:11 AM.
 
Old 04-05-2004, 11:24 AM   #8
Raul3d
Who turn off the lihgt?
 
Raul3d's Avatar
portfolio
Raul Fraile
Madrid (Spain), España
 
Join Date: Dec 2001
Posts: 156
This tutorial could help you
 
Old 04-05-2004, 11:55 AM   #9
alexx
Yes, I Listen...
 
alexx's Avatar
Technical Director / 3D Artist
 
Join Date: Feb 2002
Posts: 2,202
i can only double what jackdeth wrote.

maya´s z-channel (basically the z-channel of any 3d app) is basically the "more correct" one, but gives you more problems, since as wrote it is not anti aliased.

but mostly it is not necessary to render out a seperate z-pass, when you have a little knowledge about your comp app and you are able to change the z-channel with nodes like blur dilate/errode and edge detect.
only in very few compositings i really had to render the extra anti aliased pass.

cheers

alexx
__________________
"A computer program does what you tell it to do, not what you want it to do." — Greer's Third Law.
 
Old 04-05-2004, 12:26 PM   #10
lazzhar
Lazhar Rekik
 
lazzhar's Avatar
portfolio
Lazhar Rekik
3D and stuff
Algeria
 
Join Date: Mar 2003
Posts: 2,514
What really hurts is the tesselation of nurbs surfaces in the scene, because both MR and Maya Software wont give you the same results until you go doing it by yourself and dont let softwares decide. And I suppose it's not easy to tweak this values.
Jackdeath suggests a very good method that works fine for me, but all the time i'm so lazy and i'm just content with the z-depth channel included with the rendred pictures.
__________________
Lazhar Rekik
 
Old 04-05-2004, 01:27 PM   #11
thematt
brain filler
 
thematt's Avatar
matt
EMCA
France
 
Join Date: Mar 2003
Posts: 1,518
I usually rather make my own deph map shader and assign it to the object.Just a matter of taste..
I don' t have a server but you can download it here may not stay for ever..if its not on anymore Pm me or if someone want to make a mirror no problem..

cheers
Attached Files
File Type: zip zdephshader.zip (1.3 KB, 105 views)
 
Old 04-05-2004, 01:37 PM   #12
alexx
Yes, I Listen...
 
alexx's Avatar
Technical Director / 3D Artist
 
Join Date: Feb 2002
Posts: 2,202
got one to share too:

- before you run the script, be sure to save
- go to the camera you want to render with and adjust the near and far clipping planes as good as possible
- run the script
- save under a different name (!) (all other shader assignments get overwritten without asking)

z-depth MEL

it automatically sets the output image to IFF16. if you dont want that you have to change manually (which makes not much sense setting it to somthing with 8Bits)

cheers

alexx
__________________
"A computer program does what you tell it to do, not what you want it to do." — Greer's Third Law.
 
Old 04-05-2004, 02:02 PM   #13
thematt
brain filler
 
thematt's Avatar
matt
EMCA
France
 
Join Date: Mar 2003
Posts: 1,518
Oh yeah Alexx is stealing the show !!!

 
Old 04-05-2004, 02:34 PM   #14
alexx
Yes, I Listen...
 
alexx's Avatar
Technical Director / 3D Artist
 
Join Date: Feb 2002
Posts: 2,202


there must be a reason, why ppl call me a smartass
__________________
"A computer program does what you tell it to do, not what you want it to do." — Greer's Third Law.
 
Old 04-08-2004, 04:29 PM   #15
Throbberwocky
Frequenter
 
Throbberwocky's Avatar
portfolio
Tom Lippitsch
CG Artist
Freelancer
Hamburg, Germany
 
Join Date: May 2003
Posts: 203
VERY interesting ...

But does somebody know of a depth shader which is compatible with mental ray? Or how to set one up?

Thanks a lot in advance!
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:22 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.