How to use (as opposed to create) a z-depth map with Mantra?

   4320   6   1
User Avatar
Member
146 posts
Joined: Sept. 2011
Offline
I have a render plus a depth map created in other software - where / how do I plug it into Mantra (and set the black/white distances) so it knows when to occlude stuff? I need to add clouds/fog to an existing render.

Sorry, I'm sure this is ultra-basic, but googling only seems to bring up how to create depth maps, not how to use them within Houdini.

It's just plain ole' Z-depth (EXR sequence), not a DCM.
User Avatar
Member
69 posts
Joined: Nov. 2016
Offline
Not sure if I understand your need but why not occlude your clouds/fog render in comp stage instead of rendering it with the provided ZDepth pass?

Unless you're outputting deep data which I have no experience yet but it allows for the flexibility of merging objects and volumetric seamlessly without using holdout matte for the volumetric render.

I'll suggest to use directional lights to setup the BG and FG passes for the volumetric render and merge it in comp. This way you can tweak the intensity of either BG/FG passes without rendering again.

This is how I did for various fog shots in production although in Maya instead of Houdini.
Edited by huey_yeng - Jan. 24, 2018 05:14:06
User Avatar
Member
146 posts
Joined: Sept. 2011
Offline
> why not occlude your clouds/fog render in comp stage instead of rendering it with the provided ZDepth pass?

That's a different effect though - while it'll work fine for homogenous fog, the moment you have any 3D detail in your clouds, and a moving camera, simple occlusion / luma-matting doesn't work any more. The perspective'll break - while a still may look fine, objects in the middle distance will have elements of the furthest cloud appearing over them. Move the camera and it'll look wrong.

Trouble is, I can do this simply enough with other tools, but I want to use Houdini because of course I do.

It may not be possible: Houdini is big boyz toys, and I dare say the ethos is “go DCM or go home”, but I've gotta ask.

Quick example of how it works in other packages: I have a render -



And a z-depth pass:



Trapcode Particular, along with many other After Effects plugins, renders elements in 3D space. And it can use an existing depth pass (if you have one) to occlude any objects it's rendering if their depth would put them behind the Z-depth at that pixel. So using that z-depth pass, and rendering lots of little “cloud” particles gives me this:



Which then comps perfectly over the background plate:



OK, so it's not an attractive example, but you see what I mean: this is not just a depth-fog effect, it actually occludes 3D elements properly, based on the Z-depth. Which means as the camera moves forward, the clouds' perspective and 3D-ness stays intact, and stay locked correctly around the buildings. *

Can't do that with a luma matte.

In an ideal world, I'd have the whole scene's geometry within Houdini with a holdout shader; as it is, I'm asking Mantra to pretend there's holdout geometry present at such and such a depth for this pixel etc etc.

If there isn't a super-easy “oh yes, just plug your depth map in here”, it'll still be possible, just super difficult (Deep Cam stuff).

¯\_(ツ)_/¯

* part of the reason I want to use H to do this instead of the Particular approach above is that Particular's rendering those clouds as cards, so you do get that nasty “Doom” style fog layers cut off sharply by angled surfaces, which you can see if you look closely at the nearer buildings. Still better than nothing though
Edited by howiem - Jan. 24, 2018 06:44:42
User Avatar
Member
69 posts
Joined: Nov. 2016
Offline
Hmm if I were to approach it from what I've know, I'll just bring in the geometry as a holdout if you have access to it.

Funny that RGB Lighting Mask are heavily used for the fog renders for my previous fully CGI featured film and yes there are times I need to render again with a different lighting falloff to meet the director's feedback.

I never use Trapcode Particular though so I can't comment on it.

When you mentioned about moving camera, well my shots deals with subtle camera animation but the RGB Lighting Mask setup works by parenting the directional light onto the camera so the light falloff will remain constant from the camera.

So yeah either you go DCM, get the source geometry into Houdini as holdout matte or using the RGB Lighting Mask.
Edited by huey_yeng - Jan. 24, 2018 07:58:07
User Avatar
Member
146 posts
Joined: Sept. 2011
Offline
Hehe - it's just struck me: even if I can't get the geometry in, I could possibly create it on the fly using the depth map and displacement on a grid stuck to the camera. It'd only work for a simplistic effect (it's not like you could light it sensibly, nor get shadows) but at least it'd be 3D.

But that is getting a bit silly.

Shame there ain't a built-in option - it's such a simple thing to implement, programmatically - but thanks for your advice
Edited by howiem - Jan. 24, 2018 08:18:41
User Avatar
Member
7740 posts
Joined: Sept. 2011
Online
use a deep camera map? I'm not sure if you can use a flat image as Z, but there is probably a way to convert flat to deep, since all you need is a z test.

You'll need to convert your 0-1 style depth to world space though.
Edited by jsmack - Jan. 24, 2018 22:30:35
User Avatar
Member
146 posts
Joined: Sept. 2011
Offline
If nothing else, this conversation has forced me to think this whole thing through: the tools I'm used to in AE are fast and efficient, and give you that 3D-obscured-with-depth thing, but they are overly simplistic. There's no way to light (well, shadow) your elements sensibly. If you want anything approaching photorealism, DCMs'll get you halfway there, but really you just need to have the geometry there in the scene.

That said, it's a valuable tool for motion graphics. I'll stick it in an RFE and see what they say
  • Quick Links