I am trying to use an object which doesn’t render on the main pass but which renders on the custom depth pass. I want to read depth in to the buffer so that the depth of field post processing effect doesn’t effect the area occluded by the mesh.
The mesh is supposed to be a double for a translucent mesh which I want to see through clearly even though the rest of the background is blurred by DoF. I created the duplicate mesh on the custom depth pass thinking it would simply read to the depth buffer and prevent the DoF blur from happening but that isn’t the case.
If anyone can explain to me why this isn’t working (my guess is that there isn’t any easy way to fix this) that would be awesome. I’ve been pulling my hair out for days over this.
The image below shows the outline of the custom depth duplicate (and it has an opaque material applied) next to the wine glass which I would like to double it over. Notice the brick in the distance is still blurry even though the settings on the right would indicate that it is reading into the depth buffer.