Home Technical Talk

draw cells vs more polys

polycounter lvl 12
Offline / Send Message
Rockley Bonner polycounter lvl 12
say a charachter has a shirt. the body mesh under the shirt would not need rendered so I would delete the polys under the shirt wich would leave two floaty arms which would be more draw cells. When would the benifite of doing this out way creating more draw cells?

Replies

  • Bigjohn
    Options
    Offline / Send Message
    Bigjohn polycounter lvl 11
    You're losing me towards the end a bit. If you delete the polys under the shirt, then you're just saving polys. That the arms are not connected doesn't really matter. I don't see why the arms being separate would cause more draw calls than if they were connected.
  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    It is the same object just doesn't share any verts, so it wouldn't be any extra draw calls.

    It is like when some engines do batching, where for instance there are a bunch of rocks in a certain area that share the same shader, the engine might group all of those together and send them to the GPU as one draw call instead of many. So the engine combined the objects into 1, and while they don't share vertices they are 1 draw call.
  • Kurt Russell Fan Club
    Options
    Offline / Send Message
    Kurt Russell Fan Club polycounter lvl 9
    Yeah and it's the same way particle systems work. You have a thousand quads all drawn in one draw call.

    The way it works is there's usually one of two things: a special break command sent added as part of the mesh to say we want to start drawing a new section, or (more commonly) "degenerate" geo, which are just zero-sized triangles.

    So your left and right arm would be connected by an invisible quad that has two verts in the same place on the left arm and two verts in the same place on the right arm. The graphics card doesn't draw it because it is zero-sized, meaning it doesn't cover any pixels.
  • Paunescu.Daniel
    Sorry for maybe hijacking your thread but i have another example:
    Lets say i have an object that has round-ish smooth edges, and the rest of the surface is rather clean, like a table or a chair, so the normal map would only hold important information for the rounded edges. Whats better in this case, actually bevel the edges and get rid of the normal map (more polys)? Or use a normal map and use less polys?

    Lets say the normal map is 512 x 512, and by not using it i have to add more polys but what should be my polycount then? how many polygons can I add until its less optimal? I know this kind of question has a lot of variables but can we generalize it a little bit?
  • Rockley Bonner
    Options
    Offline / Send Message
    Rockley Bonner polycounter lvl 12
    oh ok cool, so I had a misunderstanding. I thought if there where unconnected parts in a single mesh it would cost rendering power.
  • Mark Dygert
    Options
    Offline / Send Message
    Keep in mind that it might create a skinning nightmare for whoever has to rig that mesh up.
    Typically having one contiguous mesh is better for characters than having stacks of layered polys that could come busting out or deform oddly once the character starts moving.

    For example:
    OverlapingGeoShirtCollar.jpg
    Just deleting those polys will help reduce the overall triangle count but it will be a nightmare to skin and those two pieces should be welded together or the topology should match almost identically so that it can be weighted and deform the same way. If it doesn't...

    StrapTopo.gif

    Necks get welded to shirts, hands get welded onto the end of sleeves, feet on the end of pants ect.
  • cryrid
    Options
    Offline / Send Message
    cryrid interpolator
    Sorry for maybe hijacking your thread but i have another example:
    Lets say i have an object that has round-ish smooth edges, and the rest of the surface is rather clean, like a table or a chair, so the normal map would only hold important information for the rounded edges. Whats better in this case, actually bevel the edges and get rid of the normal map (more polys)? Or use a normal map and use less polys?

    Lets say the normal map is 512 x 512, and by not using it i have to add more polys but what should be my polycount then? how many polygons can I add until its less optimal? I know this kind of question has a lot of variables but can we generalize it a little bit?


    I've heard in the past that a 512x512 normal map might take as much memory as around 2500 polygons, but to be honest I have absolutely no idea where those numbers came from so I'd take it with a grain of salt, and when it comes to performance I imagine there are several factors which need to be considered as well (like long and thin triangles which could be the product of a bevel)
  • JamesWild
    Options
    Offline / Send Message
    JamesWild polycounter lvl 8
    Well let's do the math here. Assuming DXT1 as a basic texture format, normal map specific formats might be smaller as they're optimised for unit vectors.

    http://en.wikipedia.org/wiki/S3_Texture_Compression#DXT1
    16 pixels per 64 bits of data.

    512x512 / 16 * 64 / 8 = 131072 bytes.

    Let's add mipmaps.

    Total comes to about 174762.5 bytes though there is some overhead due to the smaller mips being whole blocks.

    This 170kb.

    Now, worst case scenario for 2500 polygons is that none of them share vertices and they're all triangles without any triangle stripping.

    I'd say most engines would probably use a 16-bit indices array, so that's 3*2*2500 = 15000 bytes right off the bat.

    Keeping with our theme of worst case scenario, let's consider the memory usage of a vertex in a static model with no lightmapping data or anything using single floats for all.

    Location = 3x float
    UVs = 2x float
    Normal = 3x float
    Tangent = 3x float
    Bitangent = 3x float

    Total = 14 floats per indice. Multiply by four bytes per float for 56 bytes per indice.

    This totals 140000 bytes.

    140000 + 15000 = 155000 bytes = 152kb.

    Given that's an absolute worst case scenario for the indices (probably less than half that figure) but they probably carry extra data in reality and the normal map format might be smaller the figures aren't far off.
  • Paunescu.Daniel
    thanks for doing the math, at least with approximation. I wanted for quite some time to see some numbers regarding this problem.
  • McGreed
    Options
    Offline / Send Message
    McGreed polycounter lvl 15
    I can't remember from where I heard this, but there was also some issues with meshes not being closed vs doing lighting/collision I think...damn, I wish I remembered what it was.
  • Brendan
    Options
    Offline / Send Message
    Brendan polycounter lvl 8
    Lighting shouldn't be too much of a problem,if you don't mind having what's essentially another smoothing group. Open meshes for collision are a recipe for disaster if something gets inside or underneath it; which is why game engines play happier with convex hull collisions. Pure mesh collisions need a little bit of extra care but are usually OK.
Sign In or Register to comment.