Its a pain in the ass, but what I have done in the past is the following:
(FYI–this method is for c4d native render)
- make a copy (or Take) of the file. Make sure all lights are turned off.
- apply a grayscale / B&W gradient to the luminance channel of objects in the scene. Leave your Transparency/refraction/ alpha settings as they were in each material. Only channels turned on are luminance and transparency (if material/object needs it).
- Set gradient to worlld space or camera space. I would either use a gradient set to spherical or a linear gradient which begins where the camera is in space and ends at the furtherst point in the distance where there are objects still in your scene. I’ve done this with a simple xpresso setup by feeding the cameras global position into the “start” coordinates of the gradient shader, and then maybe a null that is near the outskirts at the furtherst disatnce into the end gradient position. Theres probably an easier way to do this–but this is what i remember doing --I think!
- Render this pass separately with AA turned off, and ideally at double the size of the final render. You are not rendering this via multipass–but as the actual manuall “beauty” render to get the intended dof pass you need.
You should be able to still see your DOF gradient running though the entire scene and refraction/transparency will still be present.
Composite your shot by scaling your beauty pass to the size of your manual makeshift depth pass and use the plugin of your choice to apply the depth pass to the beauty pass in your compositing program.
Then bring that comp inot a new comp and scale 50%. This will remove any fringe jaggies.
Hope that makes sense! its worked for me quite well in the past. Its beeen a while since Ive done it so hopefully I didnt forget a step here. Ive since moved on to in camera DOF, but occasionally there are still situations where you need to control dof in post–particularly when you need objects near the camera to remain in focus.