Draw Calls

Hi,

I’m a little confused when it comes to draw calls as they pertain to meshes and textures. From what I understand, each texture is a draw call and each mesh is a call. For instance, if I have a character made from 6 different meshes, this would be six draw calls. Is this correct? If I had a character made of 1 mesh but used multiple texture maps, would that mesh then have multiple draw calls?

Also, I know I need to minimize the amount of calls in my scene. Does this work per frame?

Can someone please explain how draw calls are calculated?

Thanks,

Wes

Actually, draw calls are per-material. A material is a shader + a texture (or textures). So for instance, a material could be a lightmapping material which uses a color map (normal texture) and a lightmap texture. This will be one draw call if used. Back in the day, if you had two different meshes which used this same material, you’d get two draw calls because you were rendering two separate meshes. But now with batching, if two or more meshes share the same material, they’ll get “batched” (combined) together into a single draw call.

So really all you need to know now is that you want to reuse the same material(s) as much as possible to reduce draw calls. If, hypothetically, you were able to get it so that every single object in your scene drew from the same material (meaning they’d all have to share the same texture, or textures in the case of a lightmapped shader), you would have only 1 draw call.

Does that make sense?

Yes, that does make sense. Thanks for the help! Is batching supported on the iPhone Basic?

Just to make sure that I am understanding correctly, if I have a character made from several meshes but each mesh is using the same material, that would be one draw call for the character. Is that correct?

Thanks,

Wes

Yes, that’s right, and yes, automatic batching works in Basic.

Great! Thanks for the help. One last thing. I read the basic supports Dynamic Batching but not Static Batching. Is Automatic Batching different?

thanks,

Wea

Dynamic batching is what I’m referring to, and I think that’s what you want.

Dynamic batching works for smaller objects with few polygons, but share a material.

Static batching is for things that don’t move, ala, level geometry. It is not limited (to my knowledge) to a particular poly count.

Is there a limit to Dynamic batching in terms of polygon count and if so, what is it? I could not seem to find anything on batching within the manual.

Thanks!

Wes

file:///Applications/Unity%20iPhone/Unity%20iPhone.app/Contents/Documentation/Documentation/Manual/iphone-DrawCall-Batching.html

Excellent! Thanks ReJ.