Search Unity

Custom pass vs custom post process depth

Discussion in 'High Definition Render Pipeline' started by snacktime, Feb 6, 2021.

  1. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Why does a custom post process have depth for transparent while a custom pass does not?
     
  2. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Best to check the frame debugger to find the answer, the depth pre-pass for transparent objects likely happens after your custom pass executes.
     
  3. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    depth prepass is happening before. I see the docs say camera depth will never have transparent and that does seem true even if run after post process.

    *Except* if you also have a custom post process. That somehow triggers the custom pass (which is after custom pp) to have depth. In the SetRenderTarget call if I pass the camera depth buffer sure enough no depth. If I don't pass it I have depth (unless there is no custom pp then I don't).

    That sort of seems like a bug with not resetting some type of context.