Multiple Index Buffers per mesh

Started by Rene, October 09, 2009, 10:15:07

Previous topic - Next topic

Rene

Hi all,

ATM, I'm using one index buffer for every mesh. So when drawing, the same index is used to look up the vertex, texture, and normal data. I thought this was a very inefficient approach because it's causing some data to be stored multiple times, but i can't find anywhere in the Red Book how to use multiple index buffers per mesh.

While making an OBJ importer, I noticed MAX writes OBJ files using different indices for vertex, texture and normal data, drawing my attention to this matter again.

Am I missing something and can I use multiple index buffers in OpenGL, or should the importer modify the data to use one index buffer per mesh?

Thanks in advance.
When I am king, they shall not have bread and shelter only, but also teachings out of books, for a full belly is little worth where the mind is starved - Mark Twain

spasi

This isn't possible with conventional OpenGL vertex arrays, so you'll have to expand the OBJ data and use a single index buffer. It may be possible using vertex/geometry shaders, but I think you'll find it won't be efficient enough performance-wise (it may not even be efficient memory-wise).

Rene

Got it, thanks for the help.

One more question:

In the OBJ file different groups are specified with their names. For some reason, Max names all groups 'default'. How is the group name defined in Max? I've tried changing the object name, but that didn't work.
When I am king, they shall not have bread and shelter only, but also teachings out of books, for a full belly is little worth where the mind is starved - Mark Twain

Rene

*BUMP*

FYI, I just installed Max 2010 here. I noticed the OBJ exporter in this version actually uses the object name in max as group name in the OBJ file.
When I am king, they shall not have bread and shelter only, but also teachings out of books, for a full belly is little worth where the mind is starved - Mark Twain

spasi

Hey Rene, I think I missed your previous question.

The DCC app we use in my company is Softimage XSI, so our tools are built around the dotXSI file format. It contains virtually everything we need, in a representation that perfectly matches the XSI scene. I've never used MAX and I've no idea how it handles OBJ exporting, but I believe it supports exporting scenes to the dotXSI format as well, if you want to go that way. Of course using OBJ is a more handy and simple solution if you're only interested in geometry data.

Rene

Thanks for the tip. Indeed, the obj format is very limited so I was looking for another way to get the animation data. Maybe switching to another format is indeed the best option.

My laptop is still running max 2008, and that one can't export as XSI. I'll check if 2010 can later today.

Btw, do you have a resource describing the format? I can't find anything on the net about it.
When I am king, they shall not have bread and shelter only, but also teachings out of books, for a full belly is little worth where the mind is starved - Mark Twain

spasi

Download the Softimage 7.5 SDK Guide from this page. Unzip, open start.htm, then click on Template Reference under Porting & Conversion.

Rene

Thanks, that's exactly what I was looking for.
When I am king, they shall not have bread and shelter only, but also teachings out of books, for a full belly is little worth where the mind is starved - Mark Twain