Search Unity

subpixel tris... how bad are they?

Discussion in 'General Graphics' started by gian-reto-alig, Jun 23, 2017.

  1. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Maybe a stupid question, but how bad is it to have tiny tris in otherwise low poly assets? Now don't get me wrong, I know less tris is always good, and I have found ways around them (smoothing groups for example), but I would like to find out if for example putting bevels on an ingame asset that should have 90° corners to help guide the bake and make sure normals come out okay is just increasing the triangle count, or if the subpixel tris could also lead to AA falling down or stuff like that.
    All the options have their own downsides (visual edge seams are not as bad anymore in Unity 5 when using smoothing groups it seems, but when viewed from up close might still be a no-no), so knowing that bevels are an option is good to know.

    Is there a reason to avoid tiny tris other than a tight tris budget?
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    It should only affect render performance (and memory usage, although the latter is usually dominated by textures, not polys)

    It shouldn't cause incorrect rendering, eg. AA failing, etc.

    In many (all?) modern GPU's, the pixel shader renders in 2x2 groups. If your triangle only covers 1 pixel of a 2x2 block, you will lose 75% efficiency, because the GPU could have rendered 4 pixels, but your triangle meant it only rendered 1, and 3 were wasted. So, fewer triangles that are large on screen will have greater rendering efficiency than many smaller ones covering the same area.

    Also consider that some performance loss is unavoidable, along the edges of triangles.

    Modelling with tiny triangles, or poor use of LODs, can reduce rendering efficiency. Part of that loss will be due to rendering more triangles than necessary (more vertex shader cost), but also reduced pixel shader performance for the reasons i stated above.

    Small triangles aren't entirely avoidable though, (nor should they be). They are obviously very useful in some modelling situations. It's just something to consider, rather than a strong recommendation to avoid them entirely.
     
    theANMATOR2b likes this.
  3. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    If you are going low poly it's also very probable you will be below what the gpu can render (unless old gpu), so the loss will not be felt. It matter more when you are chasing optimization and you are exceeding the gpu load.
     
    richardkettlewell likes this.