Jzone
10-04-2009 18:22:10
The Problem:
I must load between 0 and 256 copies of a mesh. The only differences between these meshes are the textures which I will apply, and their location.
What I've Done:
Originally I was using sceneManager.CreateEntity() to create each of these, but I noticed that this causes substantial load time and memory usage. (Approx. 1mb of PF per mesh, and 1-2 seconds to load each)
I then attempted to use Entity.clone(), hoping that the mesh itself would not be duplicated, simply multiple references allowing for different positioning and names. Unfortunately clone() seems to do the same as CreateEntity(), only duplicating the current mesh instead of loading a specified one.
Question:
Is there a way to quickly and with relatively low memory usage, load many instances of the same mesh, that allows for unique positioning and texturing?
Other Thoughts:
I think that this must be a common problem, and can be achieved rather simply. Unfortunately I haven't been able to find anything in the documentation or through web searches so far. If someone could point me in the right direction, I would greatly appreciate the assistance.
Thanks in advance.
| Ogre 1.6.1 | Python-Ogre 1.1 R845 Stable | Windows XP SP3 | Python 2.5.4 |
I must load between 0 and 256 copies of a mesh. The only differences between these meshes are the textures which I will apply, and their location.
What I've Done:
Originally I was using sceneManager.CreateEntity() to create each of these, but I noticed that this causes substantial load time and memory usage. (Approx. 1mb of PF per mesh, and 1-2 seconds to load each)
I then attempted to use Entity.clone(), hoping that the mesh itself would not be duplicated, simply multiple references allowing for different positioning and names. Unfortunately clone() seems to do the same as CreateEntity(), only duplicating the current mesh instead of loading a specified one.
Question:
Is there a way to quickly and with relatively low memory usage, load many instances of the same mesh, that allows for unique positioning and texturing?
Other Thoughts:
I think that this must be a common problem, and can be achieved rather simply. Unfortunately I haven't been able to find anything in the documentation or through web searches so far. If someone could point me in the right direction, I would greatly appreciate the assistance.
Thanks in advance.
| Ogre 1.6.1 | Python-Ogre 1.1 R845 Stable | Windows XP SP3 | Python 2.5.4 |