|
If I assign a mesh in the editor to a public variable in script of type "Mesh", when I assign it's content to an object (...meshFilter.mesh = ...), does Unity LOAD the Mesh then, or is it already cached in memory? I change meshes on a number of my objects over the course of the game, and I'm noticing quite a bit of slowdown, even on iPhone 3GS. This shouldn't be the case, as there are only around 20 objects, and they're all box colliders? Anyone have any ideas?
(comments are locked)
|
|
Why not attach all the various meshes to a parent gameObject, and simply turn on or off the ones you need or don't need?
(comments are locked)
|
|
When you assign the mesh, it gets loaded into the graphics hardware. I think that is what slows things down.
(comments are locked)
|
|
Any way to get around this, then? Any way to "pre-load" meshes so I don't get the performance hit?
(comments are locked)
|
|
Can you use prefabs? The performance will be far greater if you are using prefabs. Prefabs have no effect on performance. They exist primarily for convenience and workflow reasons; for example a cube placed manually and a cube instantiated as a prefab are identical in the actual scene.
Jan 26 '10 at 11:50 AM
Eric5h5
I was under the impression that prefabs use shared meshes and shared materials so performance would be improved. Certainly the tutorials I learned on stressed creation of prefabs for performance but thanks for the heads up--I learn something every day!
Jan 26 '10 at 06:36 PM
thom
(comments are locked)
|
