I would like to load my Level Geometry into a straight unmodified version of Irrlicht 1.8.* SVN.
I know that (by default) Irrlicht is limited to 16bit Index Buffers, but luckily my Level Geometry usually has less the 65536 Verts, so I thought that I would be OK...
I was wrong:
According to Blender, this mesh has 16,222 Verts and 32,448 Tris, both well under MAX_VAL for `u16` or even `s16`.
If it helps, the Mesh is loaded into a IMeshSceneNode from a .STL file.
What gives?
Just how many verts can a 16bit index store...
Re: Just how many verts can a 16bit index store...
Blender's vert count might be before triangulation in case you used quads/n-gons.
Re: Just how many verts can a 16bit index store...
@Hendu Its a generated mesh - just triangles, no quads. Blender and my mesh generator agree on the Triangle count too.
Re: Just how many verts can a 16bit index store...
16,222 sounds fine, so probably another problem. I've never worked with .STL but that loader looks simple. So if you can post a test-model to reproduce the problem I can give it a shot.
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: Just how many verts can a 16bit index store...
I did something I should have tried before: I tried a different model format (.PLY) which worked!
Here are two models in a zip: meshes.zip. Both are the same model, one in .STL and another in .PLY.
If it matters, the .STL is in Binary Format. PLY seems to work fine.
Here are two models in a zip: meshes.zip. Both are the same model, one in .STL and another in .PLY.
If it matters, the .STL is in Binary Format. PLY seems to work fine.
Re: Just how many verts can a 16bit index store...
I had the same problem with loading big .stl files. I switched to shader-pipeline branch and it worked out of the box (internally the meshbuffer is switched to 64 bit when reaching a certain limit). An alternative would be to "reprogram" the trunk branch to 64 bit, but that is a lot of work, because you have to make changes all over the engine (still it's straight forward - you begin in the loader, wait for the next compile error, correct that and so on until everything is 64 bit.
Re: Just how many verts can a 16bit index store...
Thanks for the test model. It seems the stl format does not share vertices. So for 32,448 triangles you get 97344 vertices.
The loaders should switch to 32-bit vertexbuffers in that situation, but that's not coded so far (and won't be in Irrlicht 1.9).
The loaders should switch to 32-bit vertexbuffers in that situation, but that's not coded so far (and won't be in Irrlicht 1.9).
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: Just how many verts can a 16bit index store...
I see. Thank you. I will continue to use PLY for now then.
Re: Just how many verts can a 16bit index store...
32 bit, not 64 - sorry.