Near DOF blur?

I just noticed a different complication. In the picture you posted, the gun mesh has a sharp edge. Is that because the gun is in the foreground? The blur effect probably won’t allow the foreground to blur with the background. Even if there were a way to apply different postprocess effects to the background and foreground, there’s probably no way around that sharp edge.

The only solution that comes to mind right now is kind of a silly hack. Imagine this:

Every gun has a material that contains a sharp diffuse texture and a blurry diffuse texture. Use pixel depth to lerp between the two.