Multiple instances of a mesh

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
jpeq
Posts: 8
Joined: Fri Jun 02, 2006 2:29 am
Location: Berkeley, CA

Multiple instances of a mesh

Post by jpeq »

For my project, I need to load a few meshes fully textured dozens of times each (in different positions). I also need to make them visible/invisible interactively.

The problem is that the framerate starts being really low when the number of textures/polygons of all these meshes gets huge.

So, I have three questions:

- Is it possible to create a mesh reference in a different position/rotation? like, I load the mesh and its textures only once and then replicate it without need to waste memory

- Is there a better way to make these models appear/disappear other than setVisible()? I suspect the use of setVisible(false) does not improve the performance of the engine by actually discarding the polygons and textures of the models affected.

Thanks
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Sorry, only two answers, but I couldn't see the third question :wink:
The meshes are reused, so no memory waste inside Irrlicht. However, the mesh is uploaded several times to the gfx card (only vertices, not texture) so you encounter the frame drop due to this additional communication.
Makeing all meshes invisible should bring the framerate back to the original value. If a node is not visible it is almost immediately skipped in the render phase.
Post Reply