I'm doing a particle simulation of fire embers swirling around, to be matched up to a filmed plate.
The plate has a very shallow depth of field, which creates a problem when comping it in.
It takes far to long to render the dof in cycles, so I'm applying it in nuke. The problem is, there is way to much z-occlusion for a single z-defocus to work, and as far as I know, cycles can't render deep data.
So, what I would like to do, is split the render up in, about 5 different depth slices.
I can't figure out how to do that though. At least not in a procedural way. I guess I could convert the sim, and split it up with a bunch of booleans. But, that is not very flexible. Or, I could duplicate the camera, and adjust its near/far clipping for each slice, but then I would have to render everything five times, and change a bunch of settings between renders.
The optimal way, would be if could use the layer masks, but in a "volumetric" way. So, that it masks everything outside the object, instead of behind. But that does not seem to be possible?
Any help is greatly appreciated.