Search Unity

Help Wanted 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:
    155
    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