Game Development Community

16 bit index buffer restrictions

by Yuri Dobronravin · in Torque 3D Professional · 06/19/2009 (9:04 am) · 4 replies

I have a problem exporting big meshes to T3D.

I was trying to import a model of a big house with interiors (about 200 000 polys) from 3ds Max to T3D via Collada. In T3D model looks partially broken - some polys are invalid.
While small parts of the same models exports just fine.
The reason as I've finally discovered is index buffer overflow. T3D uses 16 bit index buffer for storing model vertex information. So any model with more than 65536 vertices would be corrupted.
Seems like a very bad restriction to me. I haven't got any assert messages to warn me also (I think it's a bug).

So any suggestion on what should I do to get my model in T3D? I understand that I can break it to smaller pieces, but writing a 32 bit index buffer support is more lucrative idea to me. Maybe 16 bit index buffer is just legacy of TGE or there are any other reasons to use it instead of 32 bit?

#1
06/19/2009 (9:23 am)
You can have a model (aka: a single DAE or DTS) with more than 65K vertices. What you cannot have is a single mesh (aka: a single object inside your DAE or DTS with a single material) with more than 65K vertices.

Since the vast majority of meshes will have less than 60k vertices, I suppose you'd be wasting memory on those for the sake of a few huge meshes.

Do your house use a single material? The mere fact of assigning different textures to different polygons should break the model into multiple meshes/vertex buffers. If not, just splitting the object in multiple sub-objects in 3ds max (within the same file) should do the trick.
#2
06/19/2009 (9:55 am)
more than 60k vertices (or even that many) in a single mesh isn't too desireable anyway.
Culling is done on per mesh base, not per polygon base, so its commonly smart to keep the whole stuff within usefull boundarys.
#3
06/19/2009 (12:37 pm)
Quote:Seems like a very bad restriction to me.
It does... but really its not.

We had Torque 3D working with 32bit index buffers like 6 months ago and decided against supporting it at this time.

1. Not all graphics cards support 32bit index buffers.
2. They take up twice as much system and video memory and take twice the bandwidth to copy to the card.
3. No other AAA engine we could find supported them out of the box.

In the end we rolled back the change and fixed up a few other limitations which kept TGEA from going over 10K verts in the past.

Quote:I haven't got any assert messages to warn me also (I think it's a bug).
I totally agree. That should give you some type of warning and/or deal with it internally by supporting multiple VBs per mesh.
#4
06/23/2009 (5:15 am)
Thanks guys,

I've split my level manually and exported it. Hope GG will add some warnings about big meshes in future T3D releases.