Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Issues with flickering/pop-in depth of field effect with Post Processing v2

Discussion in 'Image Effects' started by Centribo, Oct 13, 2020.

  1. Centribo

    Centribo

    Joined:
    Nov 3, 2012
    Posts:
    6
    Hi,

    I'm currently using the Built-in Render Pipeline with the Post Processing v2 stack, (Version 2.3.0) and I'm having issues flickering issues with the depth of field effect. Right now, I've got sprite renderers to render all the objects in the game, and they are set to use a shader that writes to the depth buffer. The shaders I'm using can be found here: https://github.com/traggett/UnitySpriteShaders

    I'm using the depth of field effect to achieve a "tilt-shift" look, and it does mostly work, but it often has issues with certain objects; They tend to flicker in/out of focus and the effect is inconsistent with certain larger sprites.

    Here's a video of the issue:
    https://imgur.com/OYpSuvf

    You can see that the trees, especially at the bottom tend to flicker in/out of focus as the camera moves.
    Here's how the scene is set up from a side-view:
    Unity_2020-10-13_12-41-41.png

    And here are the depth of field settings:
    Unity_2020-10-13_12-44-05.png

    I've tried adjusting the clipping planes on the camera, adjusting anti-aliasing settings, and depth of field settings but nothing has alleviated or solved the issue. Has anyone had this issue before and have any advice?

    Thanks!
     
  2. Centribo

    Centribo

    Joined:
    Nov 3, 2012
    Posts:
    6
    Found a solution to the problem, GPU instancing must be disabled on the material(s). I'm not entirely sure why yet, but that fixes the issue. If someone has an explanation why GPU instancing affects this, please let me know!