Which is more efficient ????

Can someone tell me which is more efficient from the following two scenarios…

A - 30 models each with the same material, but with random texture picked from within 13 preset textures on each gameObject.

B - 30 models each with the same material, but with random texture picked from within 13 preset textures grabbed from a reference to one and same gameObject.

To rephrase that,
Case A, each gameObject which has a model, has a ray of a variable with 13 textures 2D, on game start, it picks one randomly.
Case B, each gameObject which has a model, on start up, looks for a gameObject and reference it to pick the texture from randomly as well.

From what i see, it has no effect at all!!!
I thought it would have a great effect, but nope, nothing, zero!

I thought since i had 30 models in the scene of the same mesh, but with different texture, and each had those 13 textures attached to, it had a big impact on memory, but after i made the adjustment and reference a separate gameObject with those 13 textures and all 30 gameObject models where picking from that one gameObject that it would reduce memory use!
to my disappointment it was just a waste of time!

Any ideas on saving memory, i had around 38 draw calls, but goes to 127 when i have 7 gameObject of the same model, but with different textures.

all models should have the same texture and the same material in order to batch. If the number of verts in a model is over 300, then you can probably forget dynamic batching. If they’re also skinned you can forget batching too.

In cases like this you’ve got no option but to do the following:

  1. use a large texture atlas for all the textures you need, for example if it’s 2048x2048, and you need 13 textures, thats 512x512 per texture on the sheet (with 3 free cells).

  2. the shader they use must be dramatically simplified. It must be single pass, and also offer a way to offset the texture from within the shader.

This won’t batch your models, but it should be faster for the GPU. Since you haven’t specified what the target platform is, I can’t really advise further but 30 high poly skinned boned meshes may be taking it’s toll. You need to profile it before going further. See manual for more optimisation tips.

Thanks for the reply,
I do understand that batching if the textures and materials were all just one material and one texture, however i do want to have different textures on the same material and i understand that this won’t batch anymore.

But, when you say a texture atlas, i have used texture atlases with Sprite manager for 2d sprites and it was done dynamically with sprite manager (the purchased version). However, how do you go about batching textures for 3d models? is there anything out there that i am not aware of that would do this ?

Second, shaders that have a single pass, i am using just a normal defuse shader, i guess this is what you referring to as a single shader?

Thus far, i had to reduce the gameObjects in the scene by removing some model details, that most likely won’t affect the game play.
But i am looking forward to your reply…

Oh, i forgot to mention that i am targeting iPhone and iPad…