使用 OpenGL 提高轮廓渲染的性能?

发布于 2024-12-01 07:37:57 字数 680 浏览 5 评论 0原文

请参阅视频

在我的应用程序中,我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤独岁月 2024-12-08 07:37:57

不再使用显示列表,而是切换到顶点数组 (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 and GL_POINTS by changing the first argument to glDrawArrays(). No need for two copies of your geometry.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文