Home Technical Talk

Clipping polygons vs. one mesh

polycounter lvl 13
Offline / Send Message
Lucas Annunziata polycounter lvl 13
So, this may seem like a really basic question, but I was wondering if there are any pros/cons to having polygons clip into eachother or is there some reason you would rather something just be one whole mesh?

Here's an example if that wasn't very clear:

question.jpg

It seems like clipping is the way to go, but I'm not sure if some engines don't have support for it?

Replies

  • PredatorGSR
    Options
    Offline / Send Message
    PredatorGSR polycounter lvl 14
    You almost always want to penetrate stuff like you've done in the right example. It is way cheaper and much easier to make. The big exception I can think of when you wouldn't want to do it would be if you have a bunch of big shapes that are uniquely textured, because then you would have a lot of wasted uv space on those large faces that are partially hidden inside of other geometry and can't be seen.
  • sprunghunt
  • EarthQuake
    Options
    Offline / Send Message
    A seamless mesh can be much better, if you're using normals etc you can create the appearance of absolutely no hard edges, however when you start chopping things up into tons of mesh chunks you really loose that ability, and your mesh will become aliased and look worse than if it was seamless. For these reasons i generally only separate chunks when i need a part to animate, or when i need to move a bit off(explode bake) to avoid intersecting with bakes.

    Being really anal about clipping things in instead of merging them properly also generally results in worst UV use, as you have many areas of your mesh that are unseen due to intersection, but still need to be textured at the same texal ratio.
  • Mark Dygert
    Options
    Offline / Send Message
    You also have to worry about vertex lighting. With the clipping example on the right, you have one vert hidden inside of a cylinder, which would shade the triangles darkly. In some cases it could be exactly what you want, in others probably not.

    HidenVertexShading00.jpg
    With that vert in the center there's a good chance you will get whats on the left, even if what you want is on the right.



    HidenVertexShading.jpg
    If you push the smaller cylinder verts into the larger you'll shade both and create even more ugly problems. If you float the smaller cylinder verts outside, the best you can hope for is on the right.


    HidenVertexShading01.jpg
    With one vert in the center you will always get shading like on the right, no matter where your light source is coming from.
    But with it contiguous you can start to get better shading, like on the left.

    What if you remove the vert in the center and save even more tris!? That gets ugly... so ugly I didn't want to document it...

    Then there is the issue of stencil shadows, which might force you to cap off the smaller cylinder if its not continuous, meaning you just created nearly as many tris as you saved but nothing is joined.

    You have to look at the handful of tris it will save and wonder if its really worth it. Weigh the risks and the rewards for your asset, your game, the engine and see what works best. It's a good exercise to think about these things when building instead of trying to fix them after its textured and in game.
  • PredatorGSR
    Options
    Offline / Send Message
    PredatorGSR polycounter lvl 14
    Ah, good points that I didn't think of. You can see why there is no real correct answer, it all depends on your prop, your project, and your tech.

    Even if you aren't using vertex lighting, lots of engines (cough udk) uses vertices for texture blending for stuff like grime, so even for more realistic games that wouldn't use vertex lighting, vig's info still applies.
Sign In or Register to comment.