Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Depth of field in URP

Discussion in 'Visual Effect Graph' started by cAyouMontreal, Mar 18, 2020.

  1. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Hi!
    Do you know if this is possible to have particles from vfxgraph being blurred out correctly when using the DoF post processing (from the pp stack included in URP)? I tried to set the particles to opaque (alpha clip or not),and active the z write, but nothing seems to work, paricles are blurred depending on the closest opaque surface on the background.

    Also on a side note: is there a way to see the actual depth buffer in the scene or game view? Or a way to debug some post process in the pp stack?

    Thank you!
     
  2. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    One quick image to illustrate this. Particles are spawned in the middle, no difference in the z position, and on the left I placed a planed at 15, on the right at 10, and set the pp DoF to blur between 10 and 15. As you can see the left part of the particles are blurred, not on the right side.

    dof_issue.png
     
    illogikaStudios likes this.
  3. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
  4. hertz-rat

    hertz-rat

    Joined:
    Nov 3, 2019
    Posts:
    71
    I read today that you can use an experimental feature to output a shadergraph material using vfx graph. You could access the depth buffer in there maybe. Not sure if its a good solution or not