rendering Z depth pass of volumetric cloud materials in Blender Internal

Hey all,

I’m trying to get two z depth pass images of two different cloud objects, to combine them in the compositor, because there is no other way to mix two volumetric material domains.(or is there a way to render them correctly, without fancy domainoverlapping black holes?)

My problem is, I only get the z pass of the cloud domain and not of the actual volume in it. I also tried something with the Mist pass, but then I’ll get a image without depth, so the volumetric object shape is completely grey.

thanks for your help

Theo

The z-buffer does not account for transparency, it assumes all objects are opaque, so what you get is the domain wall. You can’t actually store volumetric data unless you’re using a deep image format (which Blender current doesn’t support). You have two possible options of what you can store. You can either show the absolute distance to any geometry for that pixel, which the z-pass does, or you can show the average coverage*distance of the cloud, which the mist pass does.

I’m not entirely sure what you mean by “then i’ll get an image without depth”?

Thanks for your answer :slight_smile:

with the “image without depth” I mean that the Mist pass just gave me a silhouette of my volumetric obj in a single grey color. So there are no color variations between the pixels, wich I could use for calculating depth. It simply looks like a mask.

So is there a solution for using two cloud domains in one scene, while the domains are interleaved?

Ah, ok. That what’s I thought you meant. That isn’t possible with a 2D pass, because it only stores one value per pixel. It has no choice but to store a mask. As far as interleaving volumes in post, that requires something called deep compositing:

http://www.johannessaam.com/deepImage.pdf
http://www.deepimg.com/

This is actually one of the common example cases when extolling the virtues of deep compositing. You can google it for lots more info, if you want.

When you are combining a volume with a solid object, you’d usually render a holdout mask to get around the interleaving issues. As far as I can tell, you can’t render volume holdouts with BI. (setting the domain transparency to mask or putting it on a mask layer doesn’t work). So for 2 volumes, you need to either render them together or live with one being completely over the other one.

You could try this:-

You would render the volumes separately from the objects and combine them in post with the depth pass.

@J_the_Ninja: Thanks. :slight_smile: That deep image thing is a intressting thread, but yeah its not posible with two blender volume domains.

@organic: Yes if I would try that I’d only get the z pass of the cloud domain box and not of the volume itself.

You are missing the point. You render the volume on its own and use the depth pass from just the other objects, then combine the volume as images in post.

Could you make an example? I still don’t see how this should work.