使用 OpenGL 提高轮廓渲染的性能?
请参阅视频。
在我的应用程序中,我使用 GL_LINE_STRIP 创建的 DisplayList 显示轮廓堆栈。
用户可以使用鼠标选择轮廓线。为此,在渲染 DisplayList 之前,我使用唯一的颜色渲染所有轮廓并读取鼠标下的像素颜色。(如所解释的 这里)。这个渲染是 使用“立即模式”完成。
用户还可以移动、删除选定的轮廓。在这种情况下,我重新生成显示列表。
我的问题是:
1)我正在使用旧的 OpenGL 技术。(固定管道架构。)有什么方法可以使用新的 OpenGL 技术提高性能吗? (使用 GPU、着色器...等) 因为对于大量的轮廓,操作并不顺利。
2)我认为为轮廓选择所做的“立即模式”渲染也是一个性能面板。有没有更好的方法来做到这一点?
3)我需要使用 GL_POINTS 将轮廓节点显示为点云。在此,我应该使用 GL_POINTS 创建另一个 DisplayList 吗? (这意味着有两个 DisplayList;一个用于显示线,另一个用于显示点)?
Please refer to the video.
In my application, I display stack of contours using a DisplayList created using GL_LINE_STRIP.
User can select contour lines using mouse . For that ,before rendering the DisplayList, I render all contours using an unique color and read the pixel-color under the mouse .(as explained here) .This rendering is
done using "immediate mode".
User can also move,delete selected contours.In that case ,I regenerate the DisplayList.
My questions are:
1) I am using old OpenGL techniques .(fixed pipe-line architecture.) Is there any ways to improve the performance using new OpenGL techniques ? (using GPU,shaders...etc)
Because for large number of contours,the operations are not smooth.
2) I think the "immediate mode" rendering done for contour selection is also a performance panelty.Is there any better way to do this ?
3) I need to display contour nodes as a point-cloud ,using GL_POINTS.In this ,I should create another DisplayList using GL_POINTS? (that means there are two DisplayLists; one when diaplaying lines , other for displaying points)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不再使用显示列表,而是切换到顶点数组 (VA) 或 顶点缓冲对象 (VBO) 应该会给你带来不错的加速。
通过将第一个参数更改为
glDrawArrays()
。不需要几何体的两个副本。Moving away from display lists and switching to vertex arrays (VAs) or vertex buffer objects (VBOs) should give you a decent speed-up.
You can very easily switch between
GL_LINE_STRIP
andGL_POINTS
by changing the first argument toglDrawArrays()
. No need for two copies of your geometry.