Page 1 of 1

new polygons appearing in model

Posted: Thu Apr 13, 2006 2:45 pm
by TomB
Ok, so I've got a big 3DS model. A couple of weird things happening. The model is one building but coppied 7 times. Total poly count for all buildings is 20k. When I render on or two buildings in irrlicht, everything is fine. But with all of them, funny stuff starts to happen. Some faces of the meshes dissappear (I know there are tons of posts on this), but new polys appear that weren't there before. They seem to be planes that connect the buildings together. For now, we are calling them "power lines". Anyone know what that could be?

Posted: Thu Apr 13, 2006 3:10 pm
by hybrid
Yes, the disappearing faces have been fixed with the latest patch for 3ds loader. The other one seems to be a wrap around error which happens if your index count exceeds 16bit. Since you have 20k faces and each face has 3 or four indices you are stuck at this point. Either split your model into parts, or use several materials (since each mesh buffer has 16bit indices) or add the 32bit.patch or switch to IrrSpintz which has the 32bit indices per default.

Posted: Thu Apr 13, 2006 3:26 pm
by TomB
what do you mean by index count? of the materials, polygons, or indices?

stupid question but where can I find tese patches and documents about them?

so many different solution possibilities! what do you reccomend?

Posted: Thu Apr 13, 2006 3:47 pm
by hybrid
The indices are used to create faces from the single vertices that define the mesh. A simple triangle consists of three vertices. In order to keep the amount of data small when transferring vertices and faces to the gfx card the vertices are transferred only once. Then, all faces are just made up of indices which select the correct vertex from the vertex list (i.e. an array index). Irrlicht only supports plain triangle list for meshes such that you have 3 indices per face. If you have more than the allowed number of indices the high indices are not used correctly, but the low ones which are just short int wrap arounds are taken. Thus, strange artifacts appear.
The patches are at parsys.informatik.uni-oldenburg.de/~hybrid/irrlicht
You will find a short description of each patch there too, and some links to the Irrlicht forum.
If you just need several copies of the same building I'd recommend a split. Just use one building and several instances. That way single buildings could be culled easily. If you want to color the buildings differently you would have to use different materials which should also work. Adding the 32bit patch might lead to incompatabilities with other things, and IrrSpintz has a slightly different API such that you cannot easily change between the two libraries.