- Home /
performance benefits of using prefabs
In terms of performance, is it better to build the levels in Unity using prefabs, or build the whole level in an external 3d editor (Blender, Maya, etc)?
I would presume in terms of memory usage it would be better to use prefabs, but what about CPU usage? Does Unity has some magic trick when sending the geometry and textures to the GPU when using prefabs?
Answer by Eric5h5 · Aug 24, 2013 at 05:22 AM
There's nothing magic about prefabs; they are simply a convenience. There's no performance difference between putting two cubes in a scene, or making a prefab out of the cube and then putting two cube prefabs in the scene. You use prefabs so you can instantiate objects into the scene, where they don't exist in the scene to start with. (Some people get the impression somehow that you can only instantiate objects that already exist in the scene, but that's what prefabs are for.) The other convenience of prefabs is that making changes to a prefab also changes any instances of the prefab that exist, unless you override properties on the instance.
If you build an entire level in Blender or whatever, then all the geometry is unique, so possibly you could save on memory usage by using duplicates of meshes in Unity (not necessarily prefabs). The reason I say "possibly" is because if you use lightmapping, then all the geometry has to be unique anyway, so in that case there is no difference in memory usage either way.