Static B3D writing support
Static B3D writing support
https://github.com/clbr/seirr/commit/ea ... c458005fd2
https://github.com/clbr/seirr/commit/ea ... 05fd2.diff
and
https://github.com/clbr/seirr/commit/1f ... 5f0400c38d
https://github.com/clbr/seirr/commit/1f ... 0c38d.diff
These add support for exporting static B3D meshes.
https://github.com/clbr/seirr/commit/ea ... 05fd2.diff
and
https://github.com/clbr/seirr/commit/1f ... 5f0400c38d
https://github.com/clbr/seirr/commit/1f ... 0c38d.diff
These add support for exporting static B3D meshes.
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Re: Static B3D writing support
Thanks Hendu! I used it on my project to save the terrain tiles that I was saving before in XML. Load more than 10 times faster using the B3D format! (The patch worked on my version of Irrlicht SVN 1.9)
Re: Static B3D writing support
If your tiles are small enough, you might be interested in my sm1 format. It should load even faster than b3d, while creating much smaller files.
It's limited to a single mesh buffer with one texture. Max 65k verts, one pair of UVs. In other words, perfect for simple/small meshes.
It's limited to a single mesh buffer with one texture. Max 65k verts, one pair of UVs. In other words, perfect for simple/small meshes.
Re: Static B3D writing support
Nice. Hendu, can you add a link to this forum post in the patch-tracker? Just to make it a little bit more visible as it looks this could be applied without too much trouble.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Static B3D writing support
Posted both this one and the IQE one. I can't change this one from ogles to svn though.
Re: Static B3D writing support
Thanks.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Static B3D writing support
Thanks for this code, it's useful for me.
I have adapted your code to export skinned/animated meshes in the b3d format :
https://dl.dropboxusercontent.com/u/244 ... ations.zip
Note that the structure of the exported mesh is a bit different than the Hendu version, all the mesh is exported in one MESH chunk (Otherwise it's difficult to export animation)
edit : new version
I have adapted your code to export skinned/animated meshes in the b3d format :
https://dl.dropboxusercontent.com/u/244 ... ations.zip
Note that the structure of the exported mesh is a bit different than the Hendu version, all the mesh is exported in one MESH chunk (Otherwise it's difficult to export animation)
edit : new version
Last edited by JLouisB on Sun Jan 18, 2015 2:16 pm, edited 1 time in total.
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Re: Static B3D writing support
Hi, I've updated the patch from Hendu on Trunk SVN 5017. So it should be easier to incorporate. The patch has all the files, but each compiler project (MSVC, Codeblock, etc) should be updated the new files added (CB3DMeshWriter.cpp, CB3DMeshWriter.h). (The makefile was updated by Hendu and is also provided) The patch was submitted on the sourceforge project page.
Also you need to enable it in your Irrlichtconfig.h by adding this define:
_IRR_COMPILE_WITH_B3D_WRITER_
Example to use it:
Thanks JLouisB, I'll check this as we could use this to save about anything that we load in Irrlicht and save it as a "generic format" for Irrlicht.
Also you need to enable it in your Irrlichtconfig.h by adding this define:
_IRR_COMPILE_WITH_B3D_WRITER_
Example to use it:
Code: Select all
IMeshWriter* mw = device->getSceneManager()->createMeshWriter(EMWT_B3D);
if (!mw)
printf("Failed to create the mesh writer!\n");
IWriteFile* file = device->getFileSystem()->createAndWriteFile(filename.c_str());
IMesh* mesh = tile->getMesh(); //There is the reference to your model (for IRB, its a terrain tile)
if (mesh && mw && file)
mw->writeMesh(file, mesh);
Last edited by christianclavet on Sat Jan 10, 2015 8:34 pm, edited 1 time in total.
Re: Static B3D writing support
Your patch includes an unrelated CFileSystem change?
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Re: Static B3D writing support
Oups. Sorry, this is the other change I've done for the file list being all forced in uppercase (IRRLICHT BUG that was giving me problem on Linux) this CFileSystem change is unrelated to the B3D Mesh writer patch. It's only fix the file list bug.
Re: Static B3D writing support
@christianclavet : Ok. I think that it can be good if this writer can be added to Irrlicht with animations support.
I will post a new version of my code in a few days.
I will post a new version of my code in a few days.
Re: Static B3D writing support
A new version of my code (bugfixs and now the writer can be added to Irrlicht like the original writer (like christianclavet has said in this post)) :
https://dl.dropboxusercontent.com/u/244 ... ations.zip
Made for Irrlicht 1.8.1 (I havn't try to compile with svn version), tested with the models of the media folder + many other meshes.
https://dl.dropboxusercontent.com/u/244 ... ations.zip
Made for Irrlicht 1.8.1 (I havn't try to compile with svn version), tested with the models of the media folder + many other meshes.
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Re: Static B3D writing support
Ok. I will make a diff with the SVN version here and try it. Is that the one that support saving of animations?
Re: Static B3D writing support
Yes, rigg and animations support.
Re: Static B3D writing support
OK, I'll wait until there's a patch for trunk before applying it (shouldn't be really different in this case I think).
Or until christianclavet tested it with trunk and says it works.
@JLouisB: If you are able to get involved in Irrlicht development like that I'd recommend switching to svn trunk. We always try to have that stable and fix it quickly when new problems show up. And rebuilding the engine just takes a few minutes. You get more features and bugfixes there than from official releases. And it makes it easier to apply your patches then for us :-)
Or until christianclavet tested it with trunk and says it works.
@JLouisB: If you are able to get involved in Irrlicht development like that I'd recommend switching to svn trunk. We always try to have that stable and fix it quickly when new problems show up. And rebuilding the engine just takes a few minutes. You get more features and bugfixes there than from official releases. And it makes it easier to apply your patches then for us :-)
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm