View Full Version : Slow Texture Map (once again?)

06-14-2002, 04:46 AM
When Applying textures in the scene, the performances decrease awfully! I tried to do Tringle strip instead of triangles (as I read in this forum) but my code is made from a 3ds script (which I made and so I can change). This script returns an array for the faces containing the indices of the vertices in another array (also returned). so my display function is something like that:


So I had to make an orderd vector containing the indices of the vertex to be displayed thanks to GL_TRIANGLE_STRIP ... but It's very hard finding the order and I have many bugs...

I wonder if there isn't another way to reorder the indices (Must I change my script... and how?) or maybe is there a totally different way to do?


PS: I'm not very good in english and I may have made few mistakes (I think incices is the plurar of index?)

06-14-2002, 06:12 AM
You need to `stripify' your mesh. Otherwise you are probably rendering each triangle as if it were a triangle strip, which obviously won't be as quick as single triangles (degenerate case).

If you index the primitive by using glDrawElements (setting up your arrays of vertices, texture-coordinates and indices into the vertices for your triangles), you should get a significant performance increase (and you can get rid of your loop too!).

Hope this helps.

06-14-2002, 01:39 PM
OK, but I'm afraid I know that: my problem is that I have a vertex array where some points are drawn several times (thanks to a face array) but if I want to use glDrawElement, I must initialise the vertex and texture array... and I will draw some points several times...
I'd love to find a way to know which vertices will be redrawn, to make a strip instead of several triangles... It should not be incompatible with glDrawElement!
Maybe I am a little optimistic?

Anyway, I thank you for answering...

06-15-2002, 09:38 AM
Hi !

ACTC is a very nice library that converts triangles into strips or fans, maybe that could help you.


06-16-2002, 06:27 AM
Well, I think that's what I need...
I'll see how it works, but I think (and hope) you solved my problem. Thanks a lot