Is there no way to get actual depth write/depth texture to work with a 2d renderer?

I have a stacked camera setup with the base cam rendering post processing with depth of field. The foreground is an overlay cam with no pp.

I’m using sprites. In order to get actual depth based DOF working I’m using a cutout shader with no alpha blending for the background sprite objects on the DOF layer. This works fine as long I use a standard/universal URP renderer (the 3d variety) for the background cam. But with a 2d renderer the depth write or depth texture (not sure what exactly is used in what combination to create the DOF effect) appears to simply get ignored, and I’m getting the same blur no matter the distance of the object to the camera. I haven’t found any setting in the 2d renderer asset that would allow me to change this behaviour.

Of course camera stacking doesn’t work with different renderers per cam, so I’m stuck using one or the other. I don’t see anything obvious breaking right away when I change to the 3d renderer for the foreground cam too. Sprite sorting also appears to work correctly.

Is there some reason why I shouldn’t use a non-2d URP renderer with sprites and a fully 2d setup? Or is there a way to get a 2d renderer to not ignore depth?

No, I’m pretty sure you would have to fork and support yourself, so starting from URP 3D is likely easier.

I think this is the current state of things (Feb 2020):

But later (March 2022) the devs were interested in mixed 3D/2D scenes, so maybe they have something cooking: https://discussions.unity.com/t/874410