Search Unity

Question artifacts appear depending on the size of the map

Discussion in 'General Graphics' started by Volbran, Apr 6, 2021.

  1. Volbran

    Volbran

    Joined:
    Feb 24, 2020
    Posts:
    16
    if the cave is rather large, then such flickering of small polygons is observed. It is poorly visible in the video (visible on the hair on fullscreen), more noticeable on another phone. Does not depend on the shader (mobile diffuse or standart), depends on the position of the character. if the character is at point (0,0,0) and the cave is shifted under him, then everything is fine. and if you move the character to the point (300,0,300) and the cave accordingly, then the bug is in all its glory. Help me, I don’t know what the problem is
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    You're experiencing the affects of floating point precision. The further away from 0,0,0 you get, the less precision you have to work with, and the more artifacts you'll start to see. In this case your character probably has a full head model under the hair, and the two surfaces are close enough together that the lack of precision is casing the head to be visible through the hair.

    This can be fixed by modifying the model so there's no head under the hair. Or increasing the distance between the hair and the head surfaces. Or you can modify your game to re-center the world around the character so it stays closer to 0,0,0 at all times.
     
  3. Volbran

    Volbran

    Joined:
    Feb 24, 2020
    Posts:
    16
    Thanks. Great ideas. I was already going to move the world around the character. But it was found that the bug depends on the parameter "Near clip plane"
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    Because that also impacts float precision. There are lots of places within real time rendering to loose precision, and they compound on top of each other.

    But yes, pushing out the near clip plane on the camera can help, until the precision loss from the world position is alone enough to cause the issue again.