CGTalk > Software > Autodesk Maya > Maya Rendering
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 12-12-2010, 07:29 AM   #1
InfernalDarkness
Madness. Madness, I say!
 
InfernalDarkness's Avatar
portfolio
Sho Pi
CG arch/viz
Seattle, USA
 
Join Date: May 2008
Posts: 5,658
Z-depth in mental ray - Best way for instancing, methods, passes?

Still struggling to achieve a nice clean usable depth-pass workflow. I've tried many ways to make depth renders, from passes to special shaders to surface shader workflows, and am unable still to make a decent usable depth pass in a complex scene. I feel like there are so many variables that I just get lost when I go to render out a depth pass in a big scene with lots of trees and plants and complex objects being instanced or proxied around. I'll try to keep my frustration out and just lay out the issue, and hope for suggestions and workflow procedures to help...

Here's an example "test scene":



Using Puppet's p_z shader for mental ray here. The middle sphere is an original object, the others are instances. Regular BSP or Large will work with these instances, but BSP2 breaks the instancing, showing only the original source sphere in a render. No big whoop there, in a scene like this.



Here's the instances with a cutout opacity mapped into the p_z shader. All's well.

Moving to a more finished scene, I run into problems now with the cutout opacity:



No cutout opacity working on the leaves now, though... And soooo many settings to even make the depth work. Note this is NOT a depth-remapped "pass", but a separate layer. I was unable to make passes work with cutout opacity at all in instances, thus these tests of the Puppet shader.



And since I'm rendering out to .exr, I for some reason get a concurrent render of the alpha of the leaves... When I'm using .exr files, I was hoping it would be one .exr file with the depth render "embedded" or whatever. I don't know why I get two separate files, and this one completely useless for me. Extracting an alpha or object ID isn't what I wanted.

To illustrate my problem, when I'm making scenes there's often no sense of "depth" or distance in them, generally because I'm using raw mental ray renders with sun/sky and no atmospheric effects inside Maya. In the past, I would just render a zdepth render and use that in conjunction with object mask renders to add haze and blur effects to the distant parts, based on the gradient the depth pass would give me to control intensity.

This is my unfinished scene so far:



My layer edges really suck here, and there's little to no sense of "depth", but I'm using this simple scene to try to learn how to do depth renders... and failing.



Managed to get a depth pass for the background sections, but it's still gnarly and almost useless, even after I clean up the edges and remove the reference-position sphere. Certainly not a 32-bit file with any level of clarity, and I'm understanding that AA is to be avoided for depth passes. But how do I deal with my edges then?

I've searched and read and tried every thread here, and still don't know what I'm doing wrong. The variables increase so quickly and dramatically, I feel lost and would just like to know how others go about creating depth renders for complex scenes with lots of tiny objects and opacities... Any thoughts or workflows would be helpful, and at this point I'm clearing my mind and will try any techniques suggested, even if they seem like ones I've tried before. I need to isolate why/how my depth renders fail, and even better yet, how to do a concurrent depth pass with my main renders, if that's even possible.
__________________
Commodore 64 @ 1MHz
64KB RAM
1541 Floppy Drive


"Like stone we battle the wind... Beat down and strangle the rains..."

Last edited by InfernalDarkness : 12-12-2010 at 07:39 AM.
 
Old 12-12-2010, 06:28 PM   #2
m0z
SOuP cook
 
m0z's Avatar
portfolio
Mathias Markovits
CG Allrounder
ViennaPaint
Austria
 
Join Date: Apr 2010
Posts: 413
out of interest I tried the whole zdepth thing once again.

I used .rla and 32Bit framebuffer. I also used a Camera Depth pass so now I have a own zdepth file like with .exr but .rla actually works for me.

Cutout opacity works but I don't know how to fix those artefacts.

my scene:
download


the good: no need for a special shader. no need for a own render layer. mip_binaryproxy / mia_mat with cutout_opacity / bsp2 works
the bad: sampling artefacts or dunno...
Attached Images
File Type: jpg depth.jpg (68.7 KB, 109 views)
__________________
mathiasmarkovits[dot]com
 
Old 12-13-2010, 08:39 AM   #3
LinchpinZA
Know-it-All
 
LinchpinZA's Avatar
portfolio
Christopher James Ford
CG Generalist / Shader Artist
TX MOTIONMEDIA
Johannesburg, South Africa
 
Join Date: Oct 2006
Posts: 300
Hey InfernalDarkness.

I normally render zdepth using the mentalray passes system, set my near and far distance, and grade the depth pass in comp so that the furtherest point is just below white or '1' and the closest point to camera is just above black '0'.

I can imagine for the effect you're wanting to use zdepth for, with complex detailed scenes, you'll always be struggling with some unlcean edges.

But if all you're wanting the zdepth for in your scenes is atmospheric perspective, you can plug the physicalsky shader into the volume input of your camera. Once you've done that go into the attributes for the physicalsky and adjust the 'Visibility Distance' The haze attribute then adjusts the visibility falloff.

I know if you did this in comp with zdepth you could get more control with colouring the atmosperic perspective to how you want, but maybe this can be a simpler workaround for the effect you want.

-Chris.
__________________
TUMBLR
BEHANCE
VIMEO



 
Old 12-13-2010, 09:02 AM   #4
ytsejam1976
Maya Light Finder
 
ytsejam1976's Avatar
portfolio
Dario Ortisi
3D modeler and render
Dallara Engineering at Simulator
Italy
 
Join Date: Apr 2008
Posts: 937
@infernal.
Are you trying to use mip_card opacity?
__________________
www.darioortisi.it
MayAdvanced Blog
My youtube channel
 
Old 12-13-2010, 09:41 AM   #5
kiryha
Expert
 
kiryha's Avatar
portfolio
Kiryha Krysko
3D artist
Ukraine
 
Join Date: Nov 2002
Posts: 685
Send a message via ICQ to kiryha
For me, much easy to refuse cutout opacity at all in workflow, than have strugle with all problems that it involve . I did so long time ago and i`m happy now.
__________________
3D animation blog
 
Old 12-13-2010, 10:02 AM   #6
InfernalDarkness
Madness. Madness, I say!
 
InfernalDarkness's Avatar
portfolio
Sho Pi
CG arch/viz
Seattle, USA
 
Join Date: May 2008
Posts: 5,658
@ m0z: I'm using your scene as a reference and working that technique into my scene for testing. I'll post the results as soon as I get 'em.

@Linchpin: A very good idea! But since I use z-depth as a post-filtering selection method, this doesn't necessarily help me here. The point of using post-effects is that I don't have to wait for another 12-hour test render to see how crappy it's going to look: I can make it look crappy in realtime. But your idea certainly holds merit, and perhaps I can incorporate this into my workflow. It's on the tip of my mind, and I'll be trying it in conjunction with my other z-depth methods.

@ytsejam1976: No, not using the card opacity. Simply the Maya opacity, the mia_material_x cutout opacity, and specifically the p_z opacity sections. I don't see how adding another shader would help z-depth at all, since they already don't respect file cutouts very well.

@kiryha: (Edit) The types of scenes I'm working on are huge and complex. Cutout opacity is not only necessary, it's the key element to making such scenes work. Thanks for your time.


I'll post some new tests tomorrow - they take forever to work on and set up, and there's just less and less free time these days to diagnose things.
__________________
Commodore 64 @ 1MHz
64KB RAM
1541 Floppy Drive


"Like stone we battle the wind... Beat down and strangle the rains..."
 
Old 12-13-2010, 10:09 AM   #7
kiryha
Expert
 
kiryha's Avatar
portfolio
Kiryha Krysko
3D artist
Ukraine
 
Join Date: Nov 2002
Posts: 685
Send a message via ICQ to kiryha
You have to pay for everything May be some times rising quantity of poligons for one leave from 1 to 4-8 bring less problems, than using cutout?
__________________
3D animation blog
 
Old 12-13-2010, 10:21 AM   #8
InfernalDarkness
Madness. Madness, I say!
 
InfernalDarkness's Avatar
portfolio
Sho Pi
CG arch/viz
Seattle, USA
 
Join Date: May 2008
Posts: 5,658
Quote:
You have to pay for everything May be some times rising quantity of poligons for one leave from 1 to 4-8 bring less problems, than using cutout?


@kiryha: Please refer to the Forests in mental ray thread for a reference to the type of scenes we're discussing. My leaves already have a minimum poly count of 72 apiece, not 1, and scenes range from 100M polys to 100G polys. Increasing this polycount by any magnitude is not what I'm trying to do. Nor is it even possible to do with current tech. Even my old Apexx 4 would have barfed at 8 Terapolys.

I'm simply trying to extrapolate existing camera depth information from a scene that already renders properly otherwise. That is to say, everything works for me except z-depth; there's no need to go back to the drawing board on a proven and powerful technique. Also, we know mental ray is calculating the distance from the camera to each polygon and filtering it per-shader already, since it's rendering properly in the beauty pass. I merely need to extract this depth data into a usable separate image, for compositing purposes.
__________________
Commodore 64 @ 1MHz
64KB RAM
1541 Floppy Drive


"Like stone we battle the wind... Beat down and strangle the rains..."
 
Old 12-13-2010, 10:28 AM   #9
LinchpinZA
Know-it-All
 
LinchpinZA's Avatar
portfolio
Christopher James Ford
CG Generalist / Shader Artist
TX MOTIONMEDIA
Johannesburg, South Africa
 
Join Date: Oct 2006
Posts: 300
Quote:
@kiryha: (Edit) The types of scenes I'm working on are huge and complex. Cutout opacity is not only necessary, it's the key element to making such scenes work. Thanks for your time.

If I'm not mistaken, cutout opacity creates polygon tesselation on the surface at rendertime to create the cuts. Having the leaves proxied with higher polycount versions should result in similar render times to using cutout opacity, so maybe give that a try ?

Also becuase you're using zdepth for just color adjustment have you tried rendering your zdepth with the same subpixel sampling as your beauty render. zdepth passes normally need no subpixel sampling with only 1 sample per pixel, this is important when using it for DOF in post. But this isn't necesary if you're using it for color correction. I dont know if the result will be better , but its worth a try.
__________________
TUMBLR
BEHANCE
VIMEO




Last edited by LinchpinZA : 12-13-2010 at 10:56 AM.
 
Old 12-13-2010, 11:29 AM   #10
InfernalDarkness
Madness. Madness, I say!
 
InfernalDarkness's Avatar
portfolio
Sho Pi
CG arch/viz
Seattle, USA
 
Join Date: May 2008
Posts: 5,658
Quote:
If I'm not mistaken, cutout opacity creates polygon tesselation on the surface at rendertime to create the cuts. Having the leaves proxied with higher polycount versions should result in similar render times to using cutout opacity, so maybe give that a try ?


This is not the case with cutout opacity. It's simply a texture-filtering calculation - no extra polygons are generated.

But yes, subpixel sampling is certainly worth a shot. I don't believe unantialiased z-depth will be helpful in my situation given that the above scene is as simple as I need it to be, and the current unAA z-depth isn't helpful enough in postwork to make brightness-based selections accurate.

That said, I still am unable to get a full depth pass out of this scene, or others very similar to it. So until I can have all elements in this scene appear properly in the depth render, it's still a struggle to even define the variables involved for me. It feels like there are dozens of variables, and at 20-100 minute renders just to test one variable, progress is tedious and terribly frustrating.
__________________
Commodore 64 @ 1MHz
64KB RAM
1541 Floppy Drive


"Like stone we battle the wind... Beat down and strangle the rains..."
 
Old 12-13-2010, 02:01 PM   #11
Redsand1080
43% Burnt
 
Redsand1080's Avatar
portfolio
Justin Jenkins
Senior Technical Artist
Camber Corporation
USA
 
Join Date: Jul 2003
Posts: 803
Send a message via AIM to Redsand1080
Quote:
Originally Posted by InfernalDarkness
I don't believe unantialiased z-depth will be helpful in my situation given that the above scene is as simple as I need it to be, and the current unAA z-depth isn't helpful enough in postwork to make brightness-based selections accurate.


Have you tried rendering out the depth pass at double or triple res with no AA and using the triangle filter? Not sure if you're using the triangle filter for those unAA renders but Zap says that filter has less smoothing than the box so its best to use that filter for those sorts of renders. But if you render to double or triple (or greater) res and then use that to make your depth based selections and then reformat that image down afterwards your selections will be much cleaner. Its a work flow I learned from the Round 6 blog and it works really well. Worth a shot if nothing else, maybe?

-Justin
__________________
If animation is the illusion of life, then life is the illusion of reality.


"On ne sort pas DU REVE."

 
Old 12-13-2010, 04:45 PM   #12
syna
Veteran
 
syna's Avatar
portfolio
Manuel Meneres
porto, Portugal
 
Join Date: Nov 2005
Posts: 83
The method i told you woks great for me, here is one render i did some months ago with the Z-Depth done as i explained. Plus, ive rendered in 32 bit and bsp2.

i don't know why i can't upload biger images so you can see the final image and Z-Depth in this link:
http://picasaweb.google.com/1049136...7585356 591394
Attached Images
File Type: jpg z_depth.jpg (92.7 KB, 202 views)
File Type: jpg Trofa2_FINAL_low.jpg (78.4 KB, 234 views)

Last edited by syna : 12-13-2010 at 05:28 PM.
 
Old 12-13-2010, 07:17 PM   #13
Redsand1080
43% Burnt
 
Redsand1080's Avatar
portfolio
Justin Jenkins
Senior Technical Artist
Camber Corporation
USA
 
Join Date: Jul 2003
Posts: 803
Send a message via AIM to Redsand1080
Quote:
Originally Posted by syna
The method i told you woks great for me,


Could you link to the thread where you explained the method? Was it in the forests thread?

Thanks much,

Justin

**EDIT**

I found it...no need to post a link.
__________________
If animation is the illusion of life, then life is the illusion of reality.


"On ne sort pas DU REVE."


Last edited by Redsand1080 : 12-13-2010 at 07:26 PM.
 
Old 12-13-2010, 11:28 PM   #14
InfernalDarkness
Madness. Madness, I say!
 
InfernalDarkness's Avatar
portfolio
Sho Pi
CG arch/viz
Seattle, USA
 
Join Date: May 2008
Posts: 5,658
Thanks for posting those examples, Syna. Your cutout opacity certainly appears to be working properly! Great scene too, by the way.

I'm working on m0z's pass method today, one more tweak to see if I can get a depth pass itself. So far, my .rla file has no beauty pass, an accurate alpha pass, and the z-depth pass is coming out black. Gonna tweak my camera depths and try it again tonight.

Then I'll launch into your method, which is much more tedious but obviously works, Syna! Thanks for your input.
__________________
Commodore 64 @ 1MHz
64KB RAM
1541 Floppy Drive


"Like stone we battle the wind... Beat down and strangle the rains..."
 
Old 12-14-2010, 11:09 AM   #15
syna
Veteran
 
syna's Avatar
portfolio
Manuel Meneres
porto, Portugal
 
Join Date: Nov 2005
Posts: 83
To acellerate the process you can select all of your materials, go to attribute spread sheet and put weight, reflectivity, difuse, transparency and translucency to 0/off.
the only thing you need to do is to drag and drop the planar projection of the ramp in the aditional color slot. It's faster than it looks.
if anyone can write a script that makes this conection it would make the process much faster.

edit: i have uploaded to my portfolio some more pictures of the same work as that image, you can see them with better quality if you want.

Last edited by syna : 12-14-2010 at 11:46 AM.
 
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 12:19 AM.


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