I’m hard at work optimizing my draw call count. I’m seeing a weird phenomenon where certain objects will incur an extra draw call for no apparent reason.
For example, I have two background plane objects. These were created with Unity’s menu option Game Object → Create Other → Plane. (Yes I know the default Unity plane has extra polys I don’t need, will fix that later :-)). These planes use the built-in shader Transparent/Diffuse. Each of the planes incurs two draw calls. Why is this?
Diffuse needs more draw calls than a plain vertex lit shader, hence you see more draw calls for those objects. For background planes with uni lithning you could either use the self illum shader (or whatever the name is, can’t remember off head) from the startrooper demo that comes with Unity or you use the vertex lit shader.
Why would fixed function diffuse * texture need more than one draw call?
I did my own (fixed function) shader instead, and it turns out you can do whatever you want in one drawcall as long as you only use one pass. So that’s sorted, but it’s still weird that the built in shader uses two calls imo.
Built-in Diffuse shader is a pixel-lit diffuse. Try moving point light source really close to the polygon, for example. Then switch to VertexLit shader and see the difference.
Anyway, on the iPhone (since this is iPhone forum section) there’s no per pixel lighting. So draw calls will be one per object there. Use iPhone graphics emulation option.