Mesh Combiner

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Re: Mesh Combiner

Post by Lonesome Ducky »

I think I should put a disclaimer on the first post that says this code won't be much use for Minecraft clones :lol: The thing is, for a Minecraft clone you'll constantly be updating the data and you'll only want to render the cubes that you can actually see. The code is in no way suited for either of those situations. It is meant for mostly static meshes where visibility is not always known. The kind of culling you can do with a voxel-ish world would be much faster and easier to work with.
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Re: Mesh Combiner

Post by Lonesome Ducky »

I'm thinking about coming back and updating the code to allow for object movement, addition, and deletion even after creation. Is any interested in it, or is the code no longer used?
Abraxas)
Posts: 227
Joined: Sun Oct 18, 2009 7:24 am

Re: Mesh Combiner

Post by Abraxas) »

I can guarantee your code is used plenty. I've had some issues with transparent and non trans materials combines in meshes, is there a way to fix this or does the 4 mat limit stop you from doing something like a material table?
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: Mesh Combiner

Post by Brainsaw »

That would be a great addition. Although I am not doing any Irrlicht programming at the moment I hope I'll be back soon ;), and then I need a mesh combiner.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
RdR
Competition winner
Posts: 273
Joined: Tue Mar 29, 2011 2:58 pm
Contact:

Re: Mesh Combiner

Post by RdR »

Abraxas) wrote:I can guarantee your code is used plenty.
Agreed, we use it in TANK@WAR as well. Would indeed be nice with some more features!
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Re: Mesh Combiner

Post by Lonesome Ducky »

Abraxas) wrote:I can guarantee your code is used plenty. I've had some issues with transparent and non trans materials combines in meshes, is there a way to fix this or does the 4 mat limit stop you from doing something like a material table?
The old code use one material for every single mesh, so it all had to be transparent or non-transparent. I can fix this though, and combine solid and transparent objects separately (shouldn't be much of a performance impact).

Here are some additions I've been planning out:
-Support for multiple textures (This way you can use shaders to bypass the single material restriction and have independent specular, diffuse, etc.)
-Addition, deletion, and modification of existing meshes (Will only be as slow as software skinning, as the process will be nearly identical)
-Better support for transparency
-Performance improvements

The new changes will add some new difficulties and the code will most likely be entirely restructured to better suit it, but it should be well enough documented to be easily grasped
Abraxas)
Posts: 227
Joined: Sun Oct 18, 2009 7:24 am

Re: Mesh Combiner

Post by Abraxas) »

Sounds amazing. If we're adding/deleting, maybe the combined mesh should have an internal array added to the class with both integer and string attributes, to help with collision response and deletion when specific objects are concerned (maybe when adding the scene node to the array calling a function addnode(ISceneNode* node,u32 ID==-1,stringw name=="") ?
ritti
Posts: 90
Joined: Tue Apr 10, 2012 12:09 pm

Re: Mesh Combiner

Post by ritti »

Hey ho,
first of all, this is a really nice work :)
Thank you for sharing it.

But I have a little memory problem.
I'm using the meshcombiner for my mapeditor for a strategy game.
The map consists of many little different pieces and to edit the map, I change some of them, and the mesh combiner puts all this pieces together after every change.
Well now the problem is that after every time the meshcombiner puts all together the memory usage increases for about 100 MB.
I think it stores some old textures even if they aren't needed any more but I don't know how to delete them.
Or is the problem somewhere else?

Btw. I wasn't able to use the updated meshcombiner from the first post, because it gaves me a segmentation fault. Am I using it the wrong way? Or am I missing something else?

Help would be much appreciated.
Best regarts
Ritti
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Re: Mesh Combiner

Post by Virion »

ritti wrote:Hey ho,
first of all, this is a really nice work :)
Thank you for sharing it.

But I have a little memory problem.
I'm using the meshcombiner for my mapeditor for a strategy game.
The map consists of many little different pieces and to edit the map, I change some of them, and the mesh combiner puts all this pieces together after every change.
Well now the problem is that after every time the meshcombiner puts all together the memory usage increases for about 100 MB.
I think it stores some old textures even if they aren't needed any more but I don't know how to delete them.
Or is the problem somewhere else?

Btw. I wasn't able to use the updated meshcombiner from the first post, because it gaves me a segmentation fault. Am I using it the wrong way? Or am I missing something else?

Help would be much appreciated.
Best regarts
Ritti
hi ritti. i've never used mesh combiner but i think it's not advisable to use mesh combiner within your editor. use it only in your game. flag those static objects that you want to combine in the editor and check for that flag when starting your game. unity engine is doing the same thing, it will only combine/batch static meshes after you press the play button, and not during editing the level. hope this help.
kklouzal
Posts: 343
Joined: Sun Mar 28, 2010 8:14 pm
Location: USA - Arizona

Re: Mesh Combiner

Post by kklouzal »

Simply amazing work Ducky! I and the community look forward to your improvements!
(especially Addition, deletion, and modification of existing meshes) ;]
At that point every project would benefit from integration, if not into the core of Irrlicht itself.
Dream Big Or Go Home.
Help Me Help You.
gerdb
Posts: 194
Joined: Wed Dec 02, 2009 8:21 pm
Location: Dresden, Germany

Re: Mesh Combiner

Post by gerdb »

Is the code still around somewhere?

Greetings from Dresden.
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Mesh Combiner

Post by CuteAlien »

Should be the CMeshCombiner code here: https://sourceforge.net/p/irrext/code/H ... ene/IMesh/
Note there is also CBatchingMesh which also tries to do that (I have no direct comparison, probably best to try both and see which one works better for you).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply