Search Unity

Resolved Can't render sss material in custom pass

Discussion in 'High Definition Render Pipeline' started by masak, Jul 17, 2021.

  1. masak

    masak

    Joined:
    Aug 14, 2011
    Posts:
    52
    Hello,

    2021-07-17_19h44_15.png
    I tried to render a sphere with HDRP/Lit (Material Type: Subsurface Scattering) in Custom Pass.
    But the sphere looks black, no color.

    If I change Material Type to Standard, it looks fine.

    I want to know how to solve.

    Thanks
     
  2. merpheus

    merpheus

    Joined:
    Mar 5, 2013
    Posts:
    202
    A wild guess, but it might have something to do with the injection point. SSS might have a separate pass or depend on an other pass which takes place after your custom pass injection point?
     
  3. masak

    masak

    Joined:
    Aug 14, 2011
    Posts:
    52
    You are right.
    https://forum.unity.com/threads/hdr...ambient-occlusion-is-on.1138897/#post-7338361

    Overriding depth with sss material at injection point of "After Opaque Dpeth and normal" is a key.
    I could render a sss material.

    Though, I hope that Unity provides an API of rendering sss pass.
     
  4. merpheus

    merpheus

    Joined:
    Mar 5, 2013
    Posts:
    202
    So right now, if you can render the SSS material with the After Opaque depth, why do you need an api end point for a separate SSS pass access? For transparency or something? (I might get it wrong.)
     
  5. masak

    masak

    Joined:
    Aug 14, 2011
    Posts:
    52
    Of cause transparency is one reason.
    Another is that this way looks hack because i have to add sss render layer to cullingMask of main camera.
    This is completely different way with "FPS foreground" in unity custom pass samples.
     
    merpheus likes this.
  6. hugokostic

    hugokostic

    Joined:
    Sep 23, 2017
    Posts:
    84