Problem with zdepth aliasing

I am applying DOF in post using an after effects plugin. The zdepth needs to be ‘floating’ as I may need to push it to exaggerate an effect, so I have unchecked ‘clamp zdepth’. When I open up one of these zdepth renders, I am seeing harsh aliasing against the background. This messes up my DOF.

How do I stop this? I am using a Quadratic antialiasing filter at rendertime, but it doesn’t seem to be affecting the zdepth.

you want to turn off aliasing on the z-depth pass

here’s a quote from somewhere on the internet

<quote>
If you anti-alias your Z-depth pass, any anti-aliased pixels would indicate wrong depth values and result in artefacts. In case of aliased Z-depth pass and anti-aliasing on the image, the passes don’t align exactly which result in another type of edge artefacts. You can deal with the second problem by rendering your aliased Z-depth pass at double resolution. Add the oversized Z-depth pass and the image pass (scaled at 200%) in a pre-comp. Apply Lenscare and then scale the pre-comp back to 100% in another comp.
</quote>

I did wonder about this. I will give it a try. I assume a simple material overide (or the rendermask script) will enable me to render a double-sized zdepth quite quickly.

Request from Chaosgroup: can we have option to render out elements at double size?

To clarify, should I have ‘clamp zdepth’ ticked or unticked?
Also, in rendering the zdepth at double size, I should just uncheck any antialiasing filter, correct?
Should the zdepth pass be rendered with a fixed AA sampler, or should I still use my usual 1,4 min/max?

And another question - what’s the quickest and easiest way to render out a zdepth pass? I was hoping to use the script ‘RenderMask’ but it doesn’t seem to work for me (it just renders black)

to just get the zdepth pass, how about turning off lights, ref/refract, maps and gi, then rendering the sequence, only saving the pass? Reckon that will be as quick as ‘RenderMask’

Kind of why we render all utility passes as a separate job, double size, unfiltered etc. Tricky, if you see aliasing on the edges you can erode the alpha out a little bit to solve artifacts if you see any.

you could render zdepth as an extratex with a falloff map set to distance as the texture.

Thanks all.