Search Unity

Double-pass shader in HDRP, are custom passes a solution ?

Discussion in 'High Definition Render Pipeline' started by Nova-Shade, Mar 7, 2022.

  1. Nova-Shade

    Nova-Shade

    Joined:
    Oct 15, 2015
    Posts:
    136
    Hi, I'm using a model wich needs an outline material and a main material. While I only have this object in the scene I can easily achieve it with setting both materials transparent and by changing their respecive priority ( as displayed in this screenshot)

    But at the end I will have many different objects in the scene with also an outline, sometimes in front or patially behind. The main issue is since the Outline material is not written in depth I have severe issue to display all the transparent objects in the right order.


    So I'm still new with HDRP and I was wondering if the use of custom passes could help me on that ? and if there was a way to tell a material to always render after another while both are considered opaque ?

    Thank you for reading.
     
  2. Nova-Shade

    Nova-Shade

    Joined:
    Oct 15, 2015
    Posts:
    136
    I managed to fix it with some good advices I recieved externally and here are the key points I missed :

    - Keep the depth write but uses front face culling
    - Use the Depth offset in the shader if needed to adjust