Home Technical Talk

Calling multiple meshes with low vert number vs single meshes with higher verts

I'm not sure if I worded the title right, but if anyone who knows how the technical stuff works could shed some light on a question I had.

If I have a mesh, lets say for instance it's a brick wall. We'll say the wall is made out of 9 bricks. The high poly has been baked to a plane and you have your texture for the wall. Super.

What if I wanted to take this further. I know of two things I could do, excluding using tessellation/displacement.

I could modify the plane and add geometry so I can manually pull and push the mesh to give it more depth.

I could just bake the high poly bricks to low poly bricks themselves and build a wall out of them.

My question is it wasteful in terms of resources to run something like that?

So let's say I modified the wall that is a plane and I end up with a wall that had maybe 100 verts, but if I build wall of the low poly bricks I end up with 90 verts.

In a game engine would calling multiple wall objects composed of 9 meshes with 90 total verts be more intensive than a single mesh composed of 100 verts?

Replies

  • monster
    Options
    Offline / Send Message
    monster polycounter
    I'll only comment on the last questions. If your game engine uses static batching then there will be no discernible difference. However without batching the 9 meshes whould be about 9 times slower. The GPU slows down for each draw call.

    Another issue to take into consideration is that the more the geometry and UV verts are welded the faster the model will preform inside each draw call.
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    You will reach the limit a drawcall if you keep the bricks independent.
    First of all, I'm assuming that with "draw calls", you mean the command that tells the GPU to render a certain set of vertices as triangles with a certain state (shaders, blend state and so on).
    Draw calls aren't necessarily expensive. In older versions of Direct3D, many calls required a context switch, which was expensive, but this isn't true in newer versions.
    The main reason to make fewer draw calls is that graphics hardware can transform and render triangles much faster than you can submit them. If you submit few triangles with each call, you will be completely bound by the CPU and the GPU will be mostly idle. The CPU won't be able to feed the GPU fast enough.
    Making a single draw call with two triangles is cheap, but if you submit too little data with each call, you won't have enough CPU time to submit as much geometry to the GPU as you could have.
    There are some real costs with making draw calls, it requires setting up a bunch of state (which set of vertices to use, what shader to use and so on), and state changes have a cost both on the hardware side (updating a bunch of registers) and on the driver side (validating and translating your calls that set state).
    http://stackoverflow.com/questions/4853856/why-are-draw-calls-expensive


    You also have the problem of overdraw : rendering faces behind before the faces in front, which means the GPU will compute the back of the bricks before the front every time. You don't need that. (I simplified the idea, it's not exactly like that but you see my point)


    It's better to merge a maximum of meshes (but stay reasonable, otherwise the GPU will load and draw every mesh that are linked. No need to compute a mesh in your back).
  • mister_s
    Options
    Offline / Send Message
    Thanks for the feedback guys, I appreciate it. You also gave me some of the technical terms I didn't know so I was able to search the forums for more results too.
Sign In or Register to comment.