This is probably a question for Jerome J. regarding 3DS rendering since he has lots of experience - and anyone else is welcome to chime in too.
I posted this question on the OpenGL forums at: http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=302424#Post302424
Basically my issue is that I recently realized that a 3DS model can have multiple textures assigned to one “object” and the way it tells the object which textures to use is by listing the texture id for each triangle. I was using the JOGLUTILS code for rendering 3DS models and that code assumed you only had a single texture per object…meaning that when I was rendering things, the triangles were all getting the same texture and that was wrong.
I’m trying to modify the code to work correctly but I’m having trouble rendering. I initially tried to brute force render each triangle with a bind call to the appropriate texture but this was really slow and I was told that I should not have a BIND call within a glBegin/glEnd block (ie I used the glBegin(GL_TRIANGLES)). Also it was suggested that I sort the triangles to group the ones that share a texture (or material) together and hence only have as many bind calls as I have actual textures - rather than having as many bind calls as I have triangles. This will probably speed things up.
I was wondering if that was reasonable and is this what you’d recommend…this is for Immediate mode rendering.
My next question has to do with Vertex Arrays and VBOs. Because of the assumption of one texture per object, I had written VBO rendering code which renders all of the VBO buffer with the one texture. I guess I will now have to create separate VBO buffers for the textures, correct? Much like using the separate buckets for the Immediate mode?