Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice

Transparency and DOF post process in URP

Discussion in 'General Graphics' started by Dev_Mareske, Sep 14, 2021.

  1. Dev_Mareske

    Dev_Mareske

    Joined:
    Feb 4, 2014
    Posts:
    5
    Hello everyone, I hope you all have a wonderful day.

    Our Problem:
    We are struggling to get Depth of Field (Post Process) and Transparency / Particles working together.

    (Example Problem)
    Trans_Prob_01.png

    Our Goal:
    Our game is a platformer, and we want to add Depth of Field to make the Level more readable. Blur the background to make the foreground pop more.

    (Example Goal Image without DOF)
    17ceaf234d98c5a000ef2a111e8606a133bab668.png

    What we tried:
    We tried to use the New Scriptable Render Pipe from URP but because we lack experience with the Pipe, we are doing something wrong. The Idea was to put everything that has transparency on a Layer and put it in the Render after Post Process Render Queue. But this is not working for us. Either we did something wrong, or the feature has some problems. Here are some Screenshots out of unity with the Settings we tried.

    (URP Renderer Settings)
    Trans_Prob_02.png

    (Transparent Object to show that we applied the Layer)

    Trans_Prob_03.png

    (Example to show that we linked the URP Renderer in the URP Pipe)
    Trans_Prob_04.png

    Conclusion:

    Please, Señor, we need your help. If there is anyone who has some workarounds, tips or needs more information, let me know. I will be happy to provide the Information needed to fix the Problem.

    Greetings,
    Dev_Mareske
     
    Last edited: Sep 14, 2021
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    3,333
    Dev_Mareske likes this.
  3. Dev_Mareske

    Dev_Mareske

    Joined:
    Feb 4, 2014
    Posts:
    5
    We will try it out and leave feedback if it worked here.
    Thank you kdgalla.
     
  4. RyanKeable

    RyanKeable

    Joined:
    Oct 16, 2013
    Posts:
    60
    Am I to understand that you do NOT want to blur your transparents? (particles and UI for example)

    And so you are doing a blur in the PP stack and then rendering those transparents back on top??


    If so, you could take a slightly more custom approach and insert your own blur pass between opaques and transparents and leave transparents to render as per normal.

    Doing it this way you will need to enable Opaue Texture in your pipeline (I forget which asset it is on off the top of my head)

    A blur pass is pretty simple to implement yourself, you can kind of copy how Unity is implementing it and write your own Scriptable Render Feature/Pass using their blur code structure plus their blur shader processes.

    If you need more info on this feel free to ask!
     
    Dev_Mareske likes this.
  5. Dev_Mareske

    Dev_Mareske

    Joined:
    Feb 4, 2014
    Posts:
    5
    Quick Feedback.

    We tried the Camera Stacking that @kdgalla suggested, and this worked for us.
    First we had some problems with the stacking and image effects, but we managed to fix those.
    So thank you <3

    Here is the Result
    Fairyfail_Level01_DOf.png Fairyfail_Level02_DOF.png Fairyfail_Level03_DOF.png Fairyfail_Level04_DOf.png
     
unityunity