> 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