Search Unity

Retrieve volumetric fog values in post process?

Discussion in 'High Definition Render Pipeline' started by ssurget, Oct 30, 2019.

  1. ssurget

    ssurget

    Joined:
    Jun 18, 2015
    Posts:
    23
    Hello there,

    I made a custom post process appying a Sobel effect based on depth and normal. The thing is working fine and I got the same result as in built-in deferred.

    However, the Sobel is not affected by the fog (my target is volumetric fog, but normal fog doesn't apply neither). In built-in deferred, the fog was hiding the Sobel, whith nothing special to do on my side.

    See how is goes:

    No fog visible:


    With volumetric fog visible:


    Is it possible to retrieve the screen space value of the volumetric fog to apply it on a post-process? Is it hidden somewhere in the gbuffers?

    Please note that I'm "hacking" the Coat Mask in the Lit shader in order to select some areas of the models that will not be affected by the Sobel. So any solution that takes place in the renderer shader is good for me, I can merge the fog attenuation with the mask in the gbuffer2. However I did not find where the fog is actually applied :/

    Thanks in advance !
     
  2. ssurget

    ssurget

    Joined:
    Jun 18, 2015
    Posts:
    23
    Hi, still can't find the way to retrieve the fog values :(

    There is a Fog node in Shader Graph, but it's only compatible with LWRP.
    Is there any chance it will be made for HDRP as well?