Z-depth in mental ray - Best way for instancing, methods, passes?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 01 January 2012   #61
I did read that thread as well, hope you're making some progress! The problem with semi-transparent masks is outlined best by Bitter above, though. In your compositing application, you may have issues making it work how you want. But I really hope you don't! This process was a nightmare for me as well for a long time, but it gets easier. Keep at it!
Commodore 64 @ 1MHz
1541 Floppy Drive

"Like stone we battle the wind... Beat down and strangle the rains..."
Old 01 January 2012   #62
Oracio, please excuse my triteness in earlier posts. I'm trying to pull z-depth with cutout opacity on a new scene and it is failing utterly. I have gone through every single step outlined here and in the other threads, and alas... Utter failure on my part to replicate anything usable.

I'm far too frustrated to continue tonight. Will approach this problem yet again (and likely look into Vray yet again, too!) in the morning. I'd say I can't believe it is so goddamn difficult to achieve this simplest of tasks in mental ray, but it is very, very believable.

There are two shaders here, both mia_mat_x_passes. Note the foreground objects work fine, the instances do not. And what the hell is that two-pixel dot doing there, on the mid-right?!? (grins)
Commodore 64 @ 1MHz
1541 Floppy Drive

"Like stone we battle the wind... Beat down and strangle the rains..."
Old 01 January 2012   #63
Hey Infernal,

Have you tried the p_z shader? it works for me with instancing.
Create a new Render Layer with all your objects.
Create a new p_z shader for each of your materials in your scene and connect
to it your cutout opacity texture file.
If you want to automate it (because it can get tedious), you can use this small script
that I created:

Good luck
Old 01 January 2012   #64

Duplicates working fine; instances are not. Weird reversals, artifacts, and the extraneous spot on the right. I hoped my depth was just off, and I was seeing a repetition of the map, but increasing it from 300 to 500 to 1000 made no change in the instances, only in the duplicates.

I have "leveled down" evidently, but won't give up just yet.

@Oracio: As mentioned already, I have used the p_z shader successfully in many tests but it has many issues as well. The biggest one being that's a render layer, not a render pass. But also you would be creating one shader for each leaf/flower/plant shader, and in a simple scene this may be workable, but in a scene with 20 or 30 (I believe this scene has 23) shaders it becomes quite a nightmare to work with.

The goal of using a render pass is that it takes almost no extra rendertime, as the data was already utilized during the initial render. And it needs to be relatively painless and re-doable on the fly, for big scenes and animations. The theory works fine; the practice has many variables and I simply have not isolated them all yet. One little checkbox somewhere I missed, this time.

Edit: resolved.

Problem re-re-re-resolved. Having no geometry as a far-end evidently was the problem. A simple poly plane backdrop solved the issue outright. All except the original two objects are instances, and the z-depth appears to be working flawlessly. No AA or anything, as you can see in the perpendicular object planes! Some tone-mapping would help in comp, but it's obviously working again and respecting cutout opacity. My guess is the lack of any backdrop was tossing back an inverse result, thus the previous artifacts and weird dots.

I just couldn't call it a day before figuring it out again. Posted this in case anyone else runs into problems with z-depth...

(Another Edit!)

Sorry Dario, I believe we were typing at the same time?
Commodore 64 @ 1MHz
1541 Floppy Drive

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

Last edited by InfernalDarkness : 01 January 2012 at 10:26 AM.
Old 01 January 2012   #65
Infernal, please what happen on Instance depth? Maybe i miss something on your images, but if you please explain or link the images?
MayAdvanced Blog
My youtube channel
Old 03 March 2012   #66
Is anyone able to use .exr files for depth passes?

@ytsejam1976: I think we were cross-posting, and hopefully I answered your questions in my previous post? If not, ask away and I'll try to be more specific.

But I'm running into a fun issue with the .exr file type. I get one .exr file per Render Layer, as its supposed to be, along with another .exr file for each that has "_depth" appended to the filename. I am unable to open the second file or use it in any way, and my depth pass data is not in the first .exr file either. I'm using 16-bit/half as my output mechanism, but the 32-bit float file has the same effect.

Does anyone know how to use .exr files with depth passes, in Photoshop? What am I doing wrong? I thought it would spit out one .exr file with multiple channels or layers, such as Alpha, depth, whatever you tell it to...
Commodore 64 @ 1MHz
1541 Floppy Drive

"Like stone we battle the wind... Beat down and strangle the rains..."
Old 01 January 2013   #67
Here's how this test scene "ended up", if anyone's interested. I feel that z-depth really helped develop an atmosphere in this picture.

Commodore 64 @ 1MHz
1541 Floppy Drive

"Like stone we battle the wind... Beat down and strangle the rains..."
Old 11 November 2013   #68
That's a beautiful atmosphere for a test scene!

I'm running into zDepth issues with proxies..., I read that you need the zDepth pass in the scene BEFORE exporting the proxy assembly, but it didn't work for me... :(
3D Animator and TD at www.vortice3d.com

"Donīt trust on affemeral things, only love will last..."

Visit my BLOG: 3djoie.blogspot.com
Old 11 November 2013   #69
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

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
Society of Digital Artists

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

All times are GMT. The time now is 01:11 PM.

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