How to improve the FPS and questions about VBO

Started by
0 comments, last by _the_phantom_ 17 years, 10 months ago
I have a scene that almost has 7 million triangles. The scene is made up of 23 main buildings and the connections between them. Each building has 4 LODs. The original data is from 3ds format, and I rearrange it to make all the data that share the same state together(ie, all of the data that share with the same texture are in a list, others in others lists) I create a VBO for each list with the GL_STATIC_DRAW, and draw using glDrawArrays(GL_TRIANGLES,0,m_NumVertex)(the m_NumVertex is the number of triangles in the VBO), actually I am not using indexed geometry. All the datum are loaded at the beginning of the system. In each frame, I get the list that is visual and then draw it. All of the lists that will be draw at the sequence ordered by the number of triangles, max number first and min number last and lists with texture first then list with material colors behind. As for the organization of the scene, it likes using the grid index, because all the buildings almost locate in a flat. The flat is split into many cells, and the buildings in the cell as a point, each building including many files that holding the data, actually it is the file as a point in a cell. When the cell comes to fields of view then get the points in it and load the files that correspond to it. (I change that not to load the data but just record the file because all of the datum were loaded at the beginning of the system) But I get a poor fps. In this way, when in a frame, maybe just few files are in views so I get the lists that correspond to the files then draw all the lists. The question is I draw extra data each frame. So maybe use indexed geometry can draw less. But in this situation, it seems that the card driver has to transfer the data to the card each frame, for the card memory is not enough to hold all the data.(I’m using a nVidia GeForce FX 5700 Ultra with 128M. Maybe the newest card will be better, but if that can not hold all the data what should I do). Another question is about the VBO. I am just beginning to learn it. Here I understand the static geometry is that object’s vertex will not change position x,y,z and normal vector and texture coordinate all the time. So all of the buildings in my sence can be think as static, for not change from load to shutdown. Is that right? But is there any suggestion on how to manage the VBOs, how can I exclude the data that are not seen in the frame, or should I spilt the huge VBO into smaller, as for indexed geometry, the index should not to larger than 65K (unsigned short). So how should I arrange the data use vbo, or other way that will be faster than vbo? Do you have other solutions to task of render the scene better than my using? Thank you every much. You can contact me with ICQ:319-640-098
Bopi
Advertisement
The first thing you should be doing is using indexed geometry. Indexed Triangle lists are MUCH faster than none indexed, so swap that glDrawArrays() call for a glDrawRangeElements() call instead.

From your description, yes your builds are indeed static.

VBO management isn't all that tricky; make sure you don't have huge VBOs or really small ones.

A bit vague I admit, but it is gone 5am for me [wink]
Index data is best kept under thr 65K/16bit target as some hardware has a very bad reaction to 32bit indices.

Based on your 7million triangle count however, you are certainly going to need to split the builds up a bit between a few VBOs if you want to use 16bit indices.

This topic is closed to new replies.

Advertisement