如何在 GTX 560 及更高版本上使用 OpenGL 进行立体 3D? [英] How to do stereoscopic 3D with OpenGL on GTX 560 and later?

查看:22
本文介绍了如何在 GTX 560 及更高版本上使用 OpenGL 进行立体 3D?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用在 Windows 7 上运行的开源触觉和 3D 图形库 Chai3D.我已经重写了该库以使用 Nvidia nvision 进行立体 3D.我使用 OpenGL 和 GLUT,并使用 glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE | GLUT_STEREO) 来初始化显示模式.它在 Quadro 卡上运行良好,但在 GTX 560m 和 GTX 580 卡上它表示不支持像素格式.我知道显示器能够显示 3D,我知道显卡能够渲染它.我试过调整屏幕的分辨率和我能想到的所有其他东西,但似乎没有任何效果.我在很多地方都读到过,带有 OpenGL 的立体 3D 只能在全屏模式下工作.因此,我能想到的此错误的唯一可能原因是我以窗口模式启动.如何强制应用程序在启用 3D 的情况下以全屏模式启动?任何人都可以提供使用 OpenGL 的四缓冲立体 3D 的代码示例,该示例适用于后来的 GTX 模型卡吗?

I am using the open source haptics and 3D graphics library Chai3D running on Windows 7. I have rewritten the library to do stereoscopic 3D with Nvidia nvision. I am using OpenGL with GLUT, and using glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE | GLUT_STEREO) to initialize the display mode. It works great on Quadro cards, but on GTX 560m and GTX 580 cards it says the pixel format is unsupported. I know the monitors are capable of displaying the 3D, and I know the cards are capable of rendering it. I have tried adjusting the resolution of the screen and everything else I can think of, but nothing seems to work. I have read in various places that stereoscopic 3D with OpenGL only works in fullscreen mode. So, the only possible reason for this error I can think of is that I am starting in windowed mode. How would I force the application to start in fullscreen mode with 3D enabled? Can anyone provide a code example of quad buffer stereoscopic 3D using OpenGL that works on the later GTX model cards?

推荐答案

您的体验没有技术原因,而只是 NVidia 的产品策略.Quadbuffer 立体声被认为是一项专业功能,因此 NVidia 仅在他们的 Quadro 卡上提供它,即使 GeForce GPU 也能提供它.这不是最近的发展.早在1999年就是这样.例如,当时我有(现在还有)GeForce2 Ultra.但从技术上讲,这是与 Quadro 完全相同的芯片,唯一的区别是向系统报告的 PCI-ID.可以通过修改 PCI-ID(通过修补驱动程序或在显卡 PCB 上焊接一个额外的电阻器)来诱使驱动程序认为您拥有 Quadro.

What you experience has no technical reasons, but is simply product policy of NVidia. Quadbuffer stereo is considered a professional feature and so NVidia offers it only on their Quadro cards, even if the GeForce GPUs would do it as well. This is not a recent development. Already back in 1999 it was like this. For example I had (well still have) a GeForce2 Ultra back then. But technically this was the very same chip like the Quadro, the only difference was the PCI-ID reported back to the system. One could trick the driver into thinking you had a Quadro by tinkering with the PCI-IDs (either by patching the driver or by soldering an additional resistor onto the graphics card PCB).

当时我的 GeForce2 已经支持 Direct3D hack 的立体 3D 模式.当时,驱动程序复制了渲染命令,但对模型视图应用了平移,并对投影矩阵应用了倾斜.最近,它实现了着色器和多渲染目标技巧.

The stereoscopic 3D mode for Direct3D hack was already supported by my GeForce2 then. Back then the driver duplicated the rendering commands, but applied a translation to the modelview and a skew to the projection matrix. These days it's implemented a shader and multi rendertarget trick.

NVision3D API 确实允许您为特定的眼睛闪烁图像(这适用于电影播放器​​和图像查看器).但它也允许您模拟四缓冲立体声:代替 GL_BACK_LEFT 和 GL_BACK_RIGHT 缓冲区创建两个帧缓冲对象,您可以将它们绑定和使用,就好像它们是四缓冲立体声一样.然后在渲染后将生成的图像(作为纹理)传输到 NVision3D API.

The NVision3D API does allow you to blit images for specific eyes (this is meant for movie players and image viewers). But it also allows you to emulate quadbuffer stereo: Instead of GL_BACK_LEFT and GL_BACK_RIGHT buffers create two Framebuffer Objects, which you bind and use as if they were quadbuffer stereo. Then after rendering you blit the resulting images (as textures) to the NVision3D API.

只需 50 行管理代码,您就可以构建一个在 NVision3D 和四缓冲立体声上无缝运行的程序.NVidia 所做的一切毫无意义,他们应该立即停止并在消费类 GPU 上正确支持四缓冲立体像素格式.

With only as little as 50 lines of management code you can build a program that seamlessly works on both NVision3D as well as quadbuffer stereo. What NVidia does is pointless and they should just stop it now and properly support quadbuffer stereo pixelformats on consumer GPUs as well.

这篇关于如何在 GTX 560 及更高版本上使用 OpenGL 进行立体 3D?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆