Home Technical Talk

combing a few meshes into single one as a way to reduce drawcalls

polycounter lvl 10
Offline / Send Message
dzibarik polycounter lvl 10
Let's say I have a number of simple tables, chairs and shelves for a bar scene. I have already layed out UVS for them into a single atlas to reduce draw calls. But I want to optimize the scene even further so I was wondering - if I place furniture in my 3d package and then import it as single mesh will it be one drawcall? The target engine is Unity and I guess the answer is yes, as it's a single mesh = a bunch of vertices. The mesh shouldn't be watertight to be counted as a single drawcall, right?

Replies

  • Farfarer
    Offline / Send Message
    Farfarer polycounter lvl 17
    Yeah, if it's a single mesh, texture and material then it'll be one drawcall*.

    That said, you can import them individually, and so long as they're all using the same material instance, you can mark them as static then enable static batching. Unity will compress them all into a single mesh for you at build time.

    *Sort of. If you're in forward rendering, then it's a drawcall per pixel light affecting it, and then one for each shadow map. If you're in deferred, then it's one per GBuffer and then one for each shadow map. Maybe some more for realtime GI and such... I'm not certain how their system handles that. And if you've got baked lightmaps it'll be an extra drawcall for each lightmap on the mesh.

    My guess is that you're wanting to know if it'll be treated as a single object when it comes to rendering, and yeah, it should do.
  • dzibarik
    Offline / Send Message
    dzibarik polycounter lvl 10
    yeah, I know about static batching but I want to use array and scatter tools to save time and Unity doesn't have them afaik. And this scene will have real-time lighting.
Sign In or Register to comment.