Re: [PyOpenGL-Users] VBO help and performance
Brought to you by:
mcfletch
From: Wakefield, R. <rjw...@en...> - 2010-05-04 19:07:44
|
Now that I have a VBO working, I'm wondering what is the best way to speed up culling? My specific problem involves a 2D tilemap that is significantly larger than the screen, and the obvious solution is to calculate the indices of the on-screen vertices and use glDrawElements. I did the index array in immediate mode and there's almost no performance gain, I suspect because of CPU to GPU communication. To be clear, I have no buffer object for the indices, but the verts/textures are stored in a static VBO for the map. If I can't get a decent gain by culling to view, tests show that I'm better off using a display list. The best approach I can think of is to store the geometry data in a VBO like I do now, store the full list of Indices in another buffer object (IBO), and then have a third IBO for the data to be drawn, which will use GL_DYNAMIC_DRAW and have the appropriate memory copied from the full index with glBufferSubData calls, 1 per row of vertices (there are 20-30 rows on screen at once). Is this a good way to do things, or am I overengineering? Is there a better way to draw only the triangles appearing on-screen using some other function, perhaps glScissor? Thanks in advance! |