Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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
     
unityunity