Home Technical Talk

Stupid question about modeling and vertex count

polycounter lvl 6
Offline / Send Message
Shudrum polycounter lvl 6
Hi all !

I have a question about vertices.

When I the this picture (from Unity best practices) :

Ry6d9or.jpg

The left one was what I see from many of you, with more vertices (center one) than mine (right one).

So, I know that I'm wrong, but I have less vertices ...

Why would you do like the first one ?

Thank you !

Replies

  • SuperFranky
    Options
    Offline / Send Message
    SuperFranky polycounter lvl 10
    You're going to get shading errors and all kinds of problems with the 3rd example. Try to unwrap it, normal map it and put it in your engine of choice and you'll see.
  • Eric Chadwick
    Options
    Offline / Send Message
    Long thin triangles are generally bad. For normal mapping, but also for rendering in general. The few extra vertices help avoid those long thin tris.
  • Shudrum
    Options
    Offline / Send Message
    Shudrum polycounter lvl 6
    This is why I've never see the problem, I don't use normal mapping. Thank you guys.

    I will learn to avoid this.
  • Eric Chadwick
    Options
    Offline / Send Message
    It's also a performance hog, rendering-wise, regardless of normal maps. Long thin triangles are harder to rasterize (turn into pixels).

    Some good reading over here:
    FAQ: Game art optimisation (do polygon counts really matter?)
  • Thane-
    Options
    Offline / Send Message
    Thane- polycounter lvl 3
    Someone said in a tutorial i watched that as long as triangles are on the same plane, they don't cause any problems. Is that true? I have a feeling it isn't :(
  • SuperFranky
    Options
    Offline / Send Message
    SuperFranky polycounter lvl 10
    Thane- wrote: »
    Someone said in a tutorial i watched that as long as triangles are on the same plane, they don't cause any problems. Is that true? I have a feeling it isn't :(

    It shouldn't be a problem for subdivision modeling, when you place triangles on a planar surface.
  • Eric Chadwick
  • marks
    Options
    Offline / Send Message
    marks greentooth
    Long thin triangles are generally bad. For normal mapping, but also for rendering in general. The few extra vertices help avoid those long thin tris.

    This, thin triangles suck and contribute a lot to pixel shader overdraw :<
  • danjohncox
    Options
    Offline / Send Message
    danjohncox polycounter lvl 7
    does this still even count for a differed renderer anymore though? This thin triangle issue?
  • Thane-
    Options
    Offline / Send Message
    Thane- polycounter lvl 3
    What is pixel shader overdraw?
    It shouldn't be a problem for subdivision modeling, when you place triangles on a planar surface.
    Are you implying that that are no problems with shading issues on low-poly models what-so-ever if triangles lie on the same plane? Just want to cross that off my list of things to worry about if i can.
  • RN
    Options
    Offline / Send Message
    RN sublime tool
    Thane- wrote: »
    What is pixel shader overdraw?
    In the context of long thin triangles, it refers to the waste of shading processing when you have a surface that's not triangulated with care.

    As a necessary step, a GPU will process triangles in a way that is efficient when rendering the interior of triangles, but not so efficient when rendering the edges of triangles.
    Therefore, if you wish to optimise the rendering of a model by means of its triangulation, you can avoid forming long thin triangles (also called slivers), which are triangles with very small angles in one or more vertices.
    With some shapes or details in your model you can't help but use long thin triangles, but when you do have the opportunity to use wider triangles, it can improve the rendering efficiency of that model.

    For you, as a 3D artist, there's the following.
    If you have a flat area in a model and you're wondering what is the most optimised way to triangulate it (which vertices to connect to each other), you can triangulate it in a progressive manner: first form the biggest AND the "most equilateral" triangle that you can in that area, then do the same with the remaining vertices until the area is fully triangulated.
    See the image below for an example, from the left with the least optimised triangulation to the right with the most optimised one (meaning, the fastest to render):

    Thin_Triangles_Circles.png

    Note that this is just an optimisation. Models that weren't triangulated with care can still work. The point is that in some cases there are more optimised triangulations to be used. You can see performance data in reference [1].

    The technical reason for why this happens is that the GPU works in 2x2 pixel blocks when rendering a triangle; it does so as a mathematical optimisation, in order to select a mipmap level and be able to do texture filtering.
    This behaviour wastes around 25% ~ 75% of the shading processing in the triangle edges, since the edges don't cover all of the pixels in the 2x2 blocks but all the pixels in these blocks are processed anyway. See [2] for more information.

    - The most optimised triangle to have in a model is an equilateral triangle.

    - When you tesselate an area, it slightly increases not only the cost in polygon count but also the cost in pixel shading (even though the covered area is the same), because of the additional triangle edges that were introduced.

    - There may be other reasons to avoid long thin triangles, such as artefacts with lighting (caused by problems with normals) and animation, but you can tell when these problems happen because they are visible and not abstract like the above.

    References:

    [1] http://www.humus.name/index.php?page=News&ID=228

    [2] https://fgiesen.wordpress.com/2011/07/10/a-trip-through-the-graphics-pipeline-2011-part-8/ (In section "You need to go wider!")

    [3] https://fgiesen.wordpress.com/2011/07/06/a-trip-through-the-graphics-pipeline-2011-part-6/#comment-3739

    [4] http://stackoverflow.com/a/3678009
  • SuperFranky
    Options
    Offline / Send Message
    SuperFranky polycounter lvl 10
    Thane- wrote: »
    What is pixel shader overdraw?


    Are you implying that that are no problems with shading issues on low-poly models what-so-ever if triangles lie on the same plane? Just want to cross that off my list of things to worry about if i can.
    I only meant subdivision modeling
Sign In or Register to comment.