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. The 2022.2 beta is now available for testing. To find out what's new, have a look at our 2022.2 feature highlights.
    Dismiss Notice
Dismiss Notice
Submit bug reports tagged with #Beta2022Win_Unity when you encounter unknown issues while testing the 2022.2 betas for a chance to win a year of Unity Pro. For more information, have a look at our Beta Sweepstakes Announcement.

Question Is it possible to use Depth of Field post processing effect with URP 2D?

Discussion in '2D Experimental Preview' started by Tony_Max, Aug 7, 2021.

  1. Tony_Max

    Tony_Max

    Joined:
    Feb 7, 2017
    Posts:
    203
    I'm using URP 2D renderer in my project and unity 2020.x (because of dots imcompatibility with 2021.x), so the highest possible URP version for me is 10.5.1 for now.
    My question is: Is it possible to somehow use Depth of Field im my project? I want my sprites which are far from the camera to be blured. I have read that it is possible to enable ZWrite in shader developed in shader graph just copying code and replace "ZWrite Off" with "ZWrite On" + change render type to opaque and render queue to geometry. All was done by me, but i see that all sprites are blured equaly no matter how far they are from the camera. Also I've found out that 3D objects also blured equaly.

    I need some advice or clarification on this, please.
     
unityunity