I have two scenarios I am weighing, trying to find a good approach that won’t bring Unity to its knees. This is in a multiplayer environment.
Let’s say I have a widget prefab with two materials. I want people to be able to create multiple instances of the prefab, customize its appearance by using different materials. But I’m concerned about performance.
Scenario 1: Create one prefab, and give the model two materials. Players can mix and match the two materials, for each copy. So, my concern is this: From what I understand, because i will be changing out the materials for each item (potentially), each copy of this object will not be batched. People might make DOZENS of these things, or more. Someone might have 20 of these, each one with a different combination of the two materials.
Scenario 2: Only allow specific ones to be made, instead of allowing people to swap out materials. For example, I might only allow people to make a blue and green one, a red and yellow one, and an orange and purple one. Obviously, this is limits variety a LOT, but at least these would be using shared materials, and batched. I would have a dedicated prefab, with one material, for each variety they can make.
Am I correct in my assessment of these two scenarios, that one would be bad for performance and one would be better?
Yes, I realize these are somewhat vague terms, but I’m hoping for insight. For all I know…the first scenario may not run as fast as the 2nd, but it might not be that big a deal. Or it might cripple unity if a few hundred of these objects exist in one scene. Or the second scenario might be problem is some ways.