Depth pass in a scene with volumes?

   3563   6   3
User Avatar
Member
62 posts
Joined: Sept. 2014
Offline
Is there a trick to rendering a depth pass in a scene that contains a volume? I’d like to add some fog in comp, but as you can see from my minimalist demo, the Z values for the volume are all over the place. I enabled the Z output by checking “Shading Depth (Pz)” under the default /out/mantra_ipr > Image > Extra Image Planes tab.



Thanks in advance,
Tim

Attachments:
Screen Shot 2020-05-16 at 10.33.54 PM.png (1.2 MB)

User Avatar
Member
8173 posts
Joined: Sept. 2011
Online
Depth is ill-defined for volumes, but you could try the minmax min sample filter with closest surface pixel filter to at least get something.
Edited by jsmack - May 17, 2020 03:59:07
User Avatar
Member
9 posts
Joined: Oct. 2018
Offline
Typically when we are dealing with volumes we would want to use deep data to have controls in post, you can also extract depth from deep render for volumes in nuke with deepexpression.

near and far variable are just userknobs for defining near and far value.

rgba.r = ((deep.front - near) / (far - near)) * rgba.alpha

rgba.g = ((deep.front - near) / (far - near)) * rgba.alpha

rgba.b = ((deep.front - near) / (far - near)) * rgba.alpha
Amir Khaefi Ashkezari
Senior FX Artist at PFX

https://github.com/Amir-Ashkezari/ [github.com]
https://www.linkedin.com/in/amir-ashkezari/ [www.linkedin.com]
User Avatar
Member
62 posts
Joined: Sept. 2014
Offline
Thanks for the responses! It turns out that I was able to get what I expected from my depth map by manually setting-up the Pz output using the “Extra Image Planes” list instead of the “Shading Depth (Pz)” checkbox, setting Sample Filter to “Closest Surface” and “Pixel Filter” to “Object With Most Coverage (minimum Z value)”. However, as you alluded, the comp results are unsatisfactory, producing unusable fringing. C’est la vie, I thought I might be able to get away with it.

The lack of fog rendering in Mantra is pretty frustrating.

Cheers,
Tim
User Avatar
Member
8173 posts
Joined: Sept. 2011
Online
you can render fog. Add another volume. Or do you mean cheap depth cue fog? You can do that in a fog shader, but I don't know how well it plays with volumes.
User Avatar
Member
62 posts
Joined: Sept. 2014
Offline
I meant depth cue fog - I’d like to create some haze, ideally with some distance-based desaturation. I’ve seen throwaway references to fog shaders here and there, but haven’t figured out how to use them - can you point me to any resources?

Many thanks,
Tim
User Avatar
Member
62 posts
Joined: Sept. 2014
Offline
As followup, for my purposes it's “good enough” to add a distance-based haze effect in the material for the ground plane - of course, this would be darned inconvenient if you had to do it for multiple materials …

Cheers,
Tim

Attachments:
Screen Shot 2020-05-17 at 4.34.58 PM.png (1.3 MB)

  • Quick Links