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

SUPER Jagged Edges and Rotating/Scaling Lines on some meshes/mesh intersections?

Discussion in 'Daydream' started by bellicapax, Nov 18, 2016.

  1. bellicapax

    bellicapax

    Joined:
    Oct 5, 2016
    Posts:
    14
    Hi, I am having an issue that I am having a hard time describing. You can see it easily in this video:

    The one constant I can find is that it looks terrible at farther distances and better/unnoticeable at closer distances. The lines rotate and scale based on your orientation toward the object they are rendered on.

    Things I have tried:
    • 2x, 4x, 8x Anti Aliasing
    • Lightmapping vs No lightmapping
    • Unity Standard vs Mobile/Diffused shaders
    • Forward vs Vertex Lit rendering
    Also, I've been following the advice in this thread for project settings. Nothing seems to make a difference so far.
     
  2. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    400
    Looks like a depth precision issue to me.. try switching to 24-bit depth buffer?
     

    Attached Files:

  3. bellicapax

    bellicapax

    Joined:
    Oct 5, 2016
    Posts:
    14
    Ugh, THANK YOU! Totally worked! :D:D:D
     
  4. Weerapan

    Weerapan

    Joined:
    Jun 26, 2013
    Posts:
    8
    @thep3000, just curious, what's a performance implication for increasing depth buffer?
    @bellicapax, have you noticed any FPS drop?

    Thank you,
    Nox
     
  5. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    400
    I don't have numbers, but you should assume that your app will take more bandwidth (and therefore, produce more heat) on most phones with a wider depth buffer (completely dependent on the architecture). If anyone has taken samples please fill us in :)
     
  6. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    Had no *idea* that was an expandable panel with options on it! Miraculous.
     
  7. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    400
    Hmm, we'll have to consider how to make that clearer or find some other place to stash device specific options. Thanks for the feedback.
     
  8. bellicapax

    bellicapax

    Joined:
    Oct 5, 2016
    Posts:
    14
    @Weerapan I haven't noticed a drop in FPS, but our app is pretty lightweight on rendering right now
     
  9. Dirly

    Dirly

    Joined:
    Mar 24, 2013
    Posts:
    19

    Is there any other solution to fixing a Z-buffering issue then changing the depth buffer to 24-bit? I'm hesitant to change that due to the performance hit. Is there something that can be done at the mesh level? It usually shows up for me when there are 2 hard edges intercepting at a distance. I guess the solution would be to combine the mesh so it would never intersect?
     
  10. wojwen

    wojwen

    Guest

    I know I'm a little bit late but there is one more way to fix this. You have to increase near clipping planes or decrease far clipping planes on the camera. As long as you decrease the range of what is visible it should help the same way enabling 24 bit depth buffer does.
     
    Last edited by a moderator: Apr 3, 2017
  11. pfreema1

    pfreema1

    Joined:
    Apr 5, 2017
    Posts:
    21
    Thanks wojwen! This helped reduce some of the depth precision problems i was experiencing.
     
  12. jmitcheson

    jmitcheson

    Joined:
    Oct 21, 2016
    Posts:
    96
    I had to look for AGES to find that depth buffer setting! I had no idea it was a drop-down either. And there are older references to it being somewhere else in the UI, so I thought it was just removed or something.

    Keyword spamming in the hopes others can find this page sooner

    24 bit depth buffer Android z-fighting zfighting

    The way I ran into this issue actually is Daydream needs a near clipping distance of 0.03 in order to examine the virtual controller while it's close to your face/the camera. When I set the clipping plane in my project that close, I had z-fighting / flickering issues until I located this setting