Its really easy, don't worry! Just search for all u16 references related to indices, add a switch like:
#ifndefine _INDICES_32
u16 *indices;
#else
u32 *indices;
#endif
Do a good search for all indices reference calls, and make sure the functions use the 32-bit value if _INDICES_32 is used.
Doing this isn't difficult and its a good way to learn you way around the code.
Loading obj mesh files with 32bit index type
Re: Loading obj mesh files with 32bit index type
> Just search for all u16 references related to indices ...
fine again - but where all?
Only in the .stl loader or all over the library?
fine again - but where all?
Only in the .stl loader or all over the library?
Re: Loading obj mesh files with 32bit index type
AReichl: Both answers are correct :-) Basically you only have to fix the loader to get 32-bit meshes working. But I think there are also still places in the library which don't support 32-bit yet. So drawing will work, some mesh-manipulation stuff might not.
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: Loading obj mesh files with 32bit index type
Got it!
I changed the stl loader in the shader-pipeline branch similar to the TerrainSceneNode. If during loading the number of indices exceeds 16bit-max (65536 or a little less) then i switch to 32bit. You could also begin with 32bit, but that would be a giveaway for small meshes.
And guess what - it runs faster than other stl-viewers i tried (specially with Directx11).
I will also try to get it working with trunk (CDynamicMeshBuffer?), but in principle the problem is solved.
I changed the stl loader in the shader-pipeline branch similar to the TerrainSceneNode. If during loading the number of indices exceeds 16bit-max (65536 or a little less) then i switch to 32bit. You could also begin with 32bit, but that would be a giveaway for small meshes.
And guess what - it runs faster than other stl-viewers i tried (specially with Directx11).
I will also try to get it working with trunk (CDynamicMeshBuffer?), but in principle the problem is solved.