Search Unity

Question HDRP Custom Pass potential draw order issue

Discussion in 'High Definition Render Pipeline' started by bellers, May 11, 2021.

  1. bellers

    bellers

    Joined:
    Nov 27, 2012
    Posts:
    1
    Hi there, we are using Unity 2020.3.6f1 (HDRP 10.4.0). We have set up a simple custom pass volume for some first person arms and are seeing an issue with the rendering.

    Here you can see a simple sword mesh on the custom pass and the settings being used (the 'FPArms' layer is of course being culled from the Main Camera).

    CustomPassSettings.png

    FPArms1.png


    As you can see from this screenshot, screen space effects from beneath the arms are coming through on top. We suspect this is screen space effects only as if we disable SSR, SSAO and contact shadows in our default settings this issue goes away (but these features are required in our project so it's not a solution!)

    Here is the same sword with the screen space effects off.

    FPArms2.png

    Are we missing something here or is there a custom solution required above and beyond the HDRP volume script component? It seems obvious we need to 'mask' these effects from our custom pass but are not sure how to go about this.

    Any help would be much appreciated.
     
  2. JZ_Focus

    JZ_Focus

    Joined:
    Nov 19, 2018
    Posts:
    24
    Hi, I had the same issues, but was sad to see you haven't had a reaction since you posted this.

    In case you still need it or need it for another project (which is probably more likely) or someone else stumbles upon this thread like me. Here is what helped me resolve the issue.

    On this repo: https://github.com/alelievr/HDRP-Custom-Passes

    The "Render With Normal Buffer" described this exact issue and resolved the issue for me. However transparent objects were not rendered due to the first pass that needs to fill the normal buffer has the injection point set to "After Opaque and Normal".

    One way of fixing this is to replace the second custom pass (the one with the "Before Transparent" injection point) with a DrawRenderersCustomPass and set the Queue to all, also select the layer mask you want to render and it should work!
     
    jiraphatK likes this.
  3. Deleted User

    Deleted User

    Guest

    Thanks for the response, it’s greatly appreciated. We had just put the problem on the back burner for a while but it still needs sorting. Looking forward to giving your solution a check. Will report back!