Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

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


    Feb 7, 2017
    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.