Best way to draw scatter plot with lots of data points in C++ using OpenGL

笑着哭i 提交于 2019-12-04 07:47:34

Using Vertex buffer Objects can increase speed rendering, because the geometry to draw can be stored directly in the graphic card memory. However, in your case, if the data always changes, I cannot tell you if this method will be faster than immediate mode because you may have to reconstruct the Vertex Array Object each time the data change. If you only add points, maybe you can make multiple VBOs to group points, and render the last received points using immediate mode until you can create a new group. For instance, if you received 100054 points, maybe you can make 10 groups of 10000 points and render the last 54 points in immediate mode.

Concerning the memory problem, I think it might be possible to store in the graphic card vertexes with 4 elements - then you could use different vertex shaders which select which components of your vertex to use as rendering coordinates. Using this technique, memory usage would only be twice what you received: one for you received data, and one for the vertex buffer object.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!