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

Does Depth of Field Bokeh/Gaussian have special requirements?

Discussion in 'Universal Render Pipeline' started by drallcom3, Jan 11, 2020.

  1. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    163
    I'm using the Bokeh Depth of Field post-processing effect on Android.

    - 2019.3.0f3 and URP 7.1.7
    - Graphics API: OpenGLES3 (and no others)
    - Depth texture forced in pipeline asset
    - Camera: Post-processing checked, depth on "use pipeline", post-processing check, NaN off

    On two ES3.2 devices bokeh, gaussian and all other post effects (that I tried) work fine.
    On an ES3.0 device bokeh doesn't work, gaussian creates some weird tiling effect and the other effects work fine.

    Does bokeh not work with ES3.0?
    I wasn't able to find any documentation about it.
     
    Last edited: Jan 11, 2020
  2. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    196
    I think some adreno graphics processors depth buffer doesn't match with unity. Because on my Lg g5(Adreno 530) i can't get depth buffer or it was different value from pc. I didn't have any time to test it. But i will test depth buffer tonight or tomorrow.
    So i did a build on my g5 and this is the result with depth buffer on shader graph shader.
    So i used scene depth raw node on shadergraph. now i will just try with vertex world pos sub camera pos depth coloring. And i tried vertex pos - cam pos to distance blend is working properly.

    Scene Depth Node(Raw)


    (Vertex Pos-Cam pos)/Distance
     
    Last edited: Jan 16, 2020
  3. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    196
    Fixed this with changing scene depth node precision to float
     
  4. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    163
    Do you happen to have the shader for me? I'm not that experienced with shader graph.
     
  5. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    196
    I am amateur guy on shaders. So i don't have any. But i just tried to tell you if you will use depth don't use it as half. Most phones supports float then half. As you can see my g5 can't realize half value. But when it is float, it do all shaders perfectly.