In terms of optimization would I be better off grouping together basic meshes like cubes with individual materials and no scripts attached, or should I make a single UV mapped mesh in a modeling program?
Is the difference small or large?
In terms of optimization would I be better off grouping together basic meshes like cubes with individual materials and no scripts attached, or should I make a single UV mapped mesh in a modeling program?
Is the difference small or large?
@Cains,
The difference in number of draw calls can be very large (hundreds or thousands to one in the worst case scenario). Whether this matters for performance depends on what else is going on in your game, but if you get high enough draw calls it will definitely limit your performance. In general, you want a) fewer materials, and b) fewer meshes. A) is more important than b), for the reasons below.
Unity has extensive documentation on batching, which is a concept closely related to what you’re describing. Combining the individual meshes in a modeling program and creating a single material that works for multiple parts of the mesh is an advanced (and usually preferred) way of manually setting up the batching.
Also try searching for unity + batching, and you’ll come across many useful tidbits like this:
Searching for draw calls returns plenty more information, including concepts like atlasing, which you may find useful. For instance: