pyglet 顶点列表未渲染(AMD 驱动程序?)

发布于 2025-01-07 15:36:32 字数 961 浏览 5 评论 0原文

我的机器显然不会在 pyglet 中绘制顶点列表。以下代码在窗口中的不同位置渲染两个相同的形状,一个使用顶点列表,另一个使用直接 draw()。直接绘制的渲染效果很好,而顶点列表根本不渲染。

import pyglet 

window = pyglet.window.Window()
w, h = window.get_size()
vl = pyglet.graphics.vertex_list( 4,
                                  ('v2i', (100,0, 100,h, 200,h, 200,0)),
                                  ('c3B', (255,255,255, 255,0,0,
                                           0,255,0, 0,0,255)) )

@window.event
def on_draw():
    window.clear()
    vl.draw( pyglet.gl.GL_QUADS )
    pyglet.graphics.draw( 4, pyglet.gl.GL_QUADS,
                          ('v2i', (300,0, 300,h, 400,h, 400,0)),
                          ('c3B', (255,255,255, 255,0,0,
                                   0,255,0, 0,0,255)) )

pyglet.app.run()

这是 Ubuntu Lucid 中的 pyglet 1.1.2,使用 AMD Radeon HD 6450 卡和最新的 Catalyst 12.1 驱动程序。我想这一定与驱动程序等有关,因为这个代码三年前在几张 NVIDIA 卡上运行过,而且它几乎直接来自 pyglet 文档。有人知道我需要进行什么设置,或者特定的驱动程序版本是否工作正常?

My machine apparently won't draw vertex lists in pyglet. The following code renders two identical shapes at different positions in the window, one using a vertex list and the other using a straight draw(). The one that's drawn directly renders fine, while the vertex list doesn't render at all.

import pyglet 

window = pyglet.window.Window()
w, h = window.get_size()
vl = pyglet.graphics.vertex_list( 4,
                                  ('v2i', (100,0, 100,h, 200,h, 200,0)),
                                  ('c3B', (255,255,255, 255,0,0,
                                           0,255,0, 0,0,255)) )

@window.event
def on_draw():
    window.clear()
    vl.draw( pyglet.gl.GL_QUADS )
    pyglet.graphics.draw( 4, pyglet.gl.GL_QUADS,
                          ('v2i', (300,0, 300,h, 400,h, 400,0)),
                          ('c3B', (255,255,255, 255,0,0,
                                   0,255,0, 0,0,255)) )

pyglet.app.run()

This is pyglet 1.1.2 in Ubuntu Lucid, using an AMD Radeon HD 6450 card with the newest Catalyst 12.1 driver. I imagine it must be something to do with the drivers, etc., because this code worked three years ago on several NVIDIA cards, and it's almost direct from the pyglet documentation. Anybody know what setting I need to futz with, or if a particular driver version works right?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

⊕婉儿 2025-01-14 15:36:32

我在 Windows 7 上使用 Radeon HD 4870 运行 Catalyst 12.2 时似乎遇到了同样的问题。在我从旧的 Geforce 8800 GTX 转移到这张卡后,我的一些早期代码也停止了部分工作,特别是 fps_counter 和标签绘图仍然有效,绘制一批没有。

在我将视频驱动程序降级到 Catalyst 11.5 后,问题就消失了(无论是上面的代码片段还是我之前的代码)。

Catalyst 的更高版本可能会起作用。我首先尝试了这个,因为它被提到在这里工作得有点正常: http:// groups.google.com/group/pyglet-users/msg/ae317c37ce54c107

更新:经过测试的催化剂11.12(最新的 11.x 版本,视频驱动程序版本 8.920.0.0000),问题又回来了。

更新 2: 经过更多测试,此问题似乎是从 Catalyst 11.9(视频驱动程序 8.892.0.0000)开始出现的。 Catalyst 11.8(视频驱动程序 8.881.0.0000)按预期工作。

解决方法是按照 此评论关于 pyglet 问题跟踪器。

最后更新: Catalyst 12.4(视频驱动程序 8.961.0.0)似乎已修复此问题。

I seem to have the same problem running Catalyst 12.2 on Windows 7 with a Radeon HD 4870. Some earlier code of mine stopped partially working as well after I moved to this card from my older Geforce 8800 GTX, specifically the fps_counter and label drawing still worked, drawing a batch didn't.

After I downgraded the video driver to Catalyst 11.5 the problems went away (both with your snippet above and with my earlier code).

Later versions of Catalyst might work. I tried this one first because it is mentioned as working somewhat properly overhere: http://groups.google.com/group/pyglet-users/msg/ae317c37ce54c107

Update: Tested Catalyst 11.12 (the latest 11.x release, video driver version 8.920.0.0000) and the problem has returned.

Update 2: Some more testing later, it appears this issue started occuring with Catalyst 11.9 (video driver 8.892.0.0000). Catalyst 11.8 (video driver 8.881.0.0000) worked as expected.

A work-around is to use v2f instead of v2i as per this comment on the pyglet issue tracker.

Last update: This problem seems to be fixed with Catalyst 12.4 (video driver 8.961.0.0).

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