I'm in a bit of a situation.
You see, when rend开发者_开发技巧ering my model with my renderMesh() function, the game was at about 30fps. When rendering to a display list, and running that, the fps went to about 450fps. Thats a gain of 1500%. I was overjoyed by this, for it meant that OpenGL wasn't the cause of the lag, it was the function, and that can be optimized.
But now I want to render a skinned mesh, so I will need to update the vertex positions per frame, but nothing else. So it would be a waste of time running renderMesh() because the overhead of patching together all the faces, ect... is unnecessary. I want to cache this data, but display lists won't work because of the volatile vertex coords.
What would be the best solution (other than to optimize my renderMesh(), which I will be doing anyway).
I can only suggest:
- Using fewer vertices
- Moving your vertices (or most of them) in rigid groups --- that way each group can be a list
- Vertex Buffer Objects
You could use VBOs and get improvement. Should be same or better then lists. 1500% improvement is strange. Are you sure you measuring FPS right?
精彩评论