Solution needed to draw assets after image effects using depth buffer information.

Thank you in advance for any help on this topic.

Ive been working on a depth based fog which has been built using top of U3’s Image effects.
Image attached below.

Im happy with how the depth fog is working but I haven’t found a way to draw particles after it or any of U3’s built in image effects for that matter, while retaining depth buffer information for sorting and rejection. Im not keen to abandon my depth fog because it achieves quite a few visual goals in respect to how emissive materials and lit surfaces interact with it plus a few other things like color ramping over depth while remaining compatible with the standard image effects.

So far I’ve tried the following approaches.

  1. Changing the Renderqueue values of the Image effect and the particles.
    no matter what I change them to the particles draw first.

  2. Adding a second camera, not clearing the buffers and culling all but the assets I want to draw last.
    Ive tried quite a few configurations with this approach but the result looks like no depth information makes it through to the second camera. I’ve had success at getting the Zbuffer to transfer between cameras when using forward lighting for both cameras, but when I create a depth buffer for the first cameras image effect the data is lost for the second camera.

heres the rough structure for both the cameras I’d like to use.

camera 1 (deferred)
Culling mask Everything but Transparent FX.
DepthFog Image effect

Camera 2 (forward)
Culling mask only Transparent FX.
Standard Bloom Image effect

Ive trawled the forums and even changed my graphics card in case it was the culprit but no luck.

Thanks again for any tips

Cheers
Brn

Added webplayer build of the scene, Its pretty raw but you can see it in action. No fallback shaders as yet so it may not run on all systems.
Hopefully prompts a response :slight_smile:

Cheers
Brn