- Home /
Alot of instances or large models?
Okay, I am designing a large open scene, now I've got a small question, is there a difference between placing alot of instances of planks, scrap metal and wood logs for example to design a house and placing the planks and logs and everything in the model itself and placing it as a combined 1 instance in lagging. Does many gameobject instances makes more lags than one gameobject instance which have the same count of polygons as the instances..
It sounds pretty silly but still might be important.
Answer by D4rt · Jul 07, 2013 at 01:37 PM
The bigger issue is if the objects have different materials.
If the materials are the same then Unity knows how to batch these objects so that they only take one draw call. Of course it's slightly more optimized to just have one mesh though anyways. This does come with a side note that apparently the free version has rather limited batching abilities.
If the materials are different, it doesn't matter if it's one mesh or several. Anyways it's going to eat as many draw calls as there are materials.
I suggest that you concentrate on minimizing the amount of materials you use.
$$anonymous$$any thanks, by the way, if I duplicate one object with the same material and set it as a floor or a fence for example, will it draw as many calls as different materials being used for each object?
Only the material will affect this altough, as I said the dynamic batching is somewhat limited. Here is the documentation for you.
http://docs.unity3d.com/Documentation/$$anonymous$$anual/DrawCallBatching.html
$$anonymous$$eep in $$anonymous$$d that batching requires you to have the same material instance, meaning that you should combine the textures into one big one. This is extra work however so I would think twice before doing it. Do you really need this optimization? You should get away without it if you don't have too many different objects in the scene. Finish what you are doing first and then optimize is a good rule of thumb.
Don't forget to mark the answer as correct if you were satisfied.
Thats not what I asked, I think.. I asked if for example I have 5 materials mt1 mt2 mt3 mt4 mt5 and 5 objects, obj1 obj2 obj3... Now is there a difference between setting mt1 for all of the five objects and between - setting each material for each object.
Will it load the material first and then set it? Or will it load the material every time it needs to be set on a gameobject?
Your answer
Follow this Question
Related Questions
MMD How to export model and animations to Unity as 3rd person controller? 2 Answers
Multiple world spaces? 0 Answers
Snapping models 3 Answers
What is the best approach to building a non terrain FPS level? 2 Answers
Trying to configure my avatar in unity 0 Answers