带有片段着色器的 OpenGL 绘制像素
我对 OpenGL 管道感到困惑。我有一个 openGL 方法,我尝试将 glDrawPixels 与片段着色器一起使用,因此我的代码如下所示:
// I setup the shader before this
glUseProgram(myshader);
glDrawPixels(...);
在某些显卡上应用着色器,但在其他显卡上则不然。我对 nvidia 没问题,但对各种 ATI 卡有问题。这是 ATI 卡的错误吗?还是英伟达只是更灵活,而我误解了管道?是否有其他方法可以解决此问题(除了纹理映射之外)?
谢谢, 杰夫
I'm confused about the OpenGL pipeline. I have an openGL method where I am trying to use glDrawPixels with a fragment shader, so my code looks like:
// I setup the shader before this
glUseProgram(myshader);
glDrawPixels(...);
On some graphics cards the shader gets applied, but on others it does not. I've no problem with nvidia, but problems with various ATI cards. Is this a bug with the ATI card? Or is nvidia just more flexible and I'm misunderstanding the pipeline? Are there alternatives to working around this (other than texture mapping)?
thanks,
Jeff
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
glDrawPixels 应该应用片段着色器。 兼容性配置文件第 203 页的图 3.1 清楚地表明了这一点。
但请注意,核心配置文件删除了 DrawPixels。您使用的是哪个 GL 版本?
glDrawPixels should have fragment shaders applied. Figure 3.1 of page 203 of the compatibility profile makes it clear.
Note however, that the core profile removes DrawPixels. Which GL version are you using ?