3 meshes, 1 material, 3 Draw Calls - Why?

Hi Folks.

I expected to get 1 draw call, not 3.

I have a vehicle about 1000 polys, so no dynamic batching. The vehicle is setup with the three meshes:

Vehicle
+Body
+Decal1
+Decal2

The texture atlas is as such

1 2 3 4
5 6 7 8
9 A B C
D E F X

where 1-F = paint jobs and X is a set of numbers in a 512x512 cell at the bottom right of the atlas:

0123456789
0123456789
0123456789
…etc.

where 0-9 is the actual digits that go on the decals. The uvs get shifted up/down and left/right to match the digit/font for the car.

To change the paint job on the car, I shift the UVs on the body mesh. To change the numbers (Decal1 and 2), I shift the UVs of the Decal1 and Decal2 meshes.

It all works. Except it’s three draw calls, not 1.

If I combine the meshes, it goes to 1 draw call, but the numbers are set to 00, and thus my UV-moving script doesn’t work properly.

I gather I can’t move the UVs because of the mesh combining, maybe I need to “reread them” after the mesh has been combined.

Is there a best practice for this? Am I missing something obvious? How do others manipulate UVs after mesh combining?

3 draw calls are becaue of the shaders / lights / shadows.

Anyway ppl need to stop worrying about draw calls :stuck_out_tongue:

You worry about them when you’re fitting it into an iOS device :slight_smile:

Anyway, just merging the meshes gives me 1 draw call. I need to be able to manipulate the uvs of 3 different sets of polygons inside the same model using the same atlas, just different parts.

I don’t know how to access the uvs after the mesh combine.

Sounds to me like you already answered your own question.

–Eric

That doesn’t answer why the two decals weren’t batched, then. They are <50 polys each. Then it should be 2 draw calls with tem dynamically batching.

It also doesn’t answer the sub-question (new post?) - how do you access/manipulate different uvs for different polygons inside a mesh?

Or am I on Mars?