Mesh Combining/Uncombining

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
g0bl1n
Posts: 63
Joined: Thu Feb 21, 2008 8:45 am

Mesh Combining/Uncombining

Post by g0bl1n »

Can anyone point me in the direction of some tutorials/examples of the mesh manipulator? I'm trying to come up with a system for destructible objects/terrain. My system works quite well, but I have a huge drop in FPS with all the render calls, so I need to make all the pieces of one terrain/destructible object one mesh, then separate the pieces as they are broken off. I'm finding it hard to find some good examples of the mesh manipulator. I found LonsomeDucky's mesh combiner, which is pretty much what I'm trying to make, but I'm not getting much out of it in terms of knowing what it's doing. I'd rather make my own system so I understand everything, instead of using something that works, but having no clue about how it works! I've tried searching the forums, but I haven't had much luck yet...

Thanks!
Goblin
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: Mesh Combining/Uncombining

Post by Radikalizm »

Dynamic destruction of meshes is a rather hard topic, the mesh combiner you talk about is mostly efficient for combining multiple static meshes to reduce render calls
From what I understand from LonesomeDucky's implementation (I could be wrong here, since I'm making assumptions) you'd have to update the combined mesh's vertex data every time a mesh contained within it changes, which can get rather expensive

I've never implemented destructible environments myself so I can't make any suggestions, but I do know certain physics libraries implement dynamic destruction
g0bl1n
Posts: 63
Joined: Thu Feb 21, 2008 8:45 am

Re: Mesh Combining/Uncombining

Post by g0bl1n »

It shouldn't be too expensive. I'm only combining the meshes of the different pieces when they are together. When a piece is broken off it becomes it's own mesh, then after a little bit is removed from the scene. I just need to figure out how to combine the smaller meshes in the beginning, then separate them (remove from combined mesh and create a new mesh of the single part). I already keep track of each piece of an object in a few vectors. As of right now I range from 27-37 FPS with 1000 objects (each with 10 pieces). Again, if I could combine the other parts into a single mesh until destruction, I think there would be a huge increase in FPS.
Post Reply