GPU供应商之间的OpenGL确定性渲染
我目前正在使用 OpenGL 编写一个科学成像应用程序。
我想知道当我的代码(C++/OpenGL 和简单 GLSL)在不同的硬件(ATI 与 NVidia、各种 NVidia 代和各种操作系统)上执行时,OpenGL 渲染(就从 FBO 检索的像素而言)是否应该是完全确定的)?
更准确地说,每次在任何硬件(可以运行基本 GLSL 和 OpenGL 3.0)上运行代码时,我都需要完全相同相同的像素缓冲区...
这可能吗?我应该考虑一些建议吗?
如果不可能,是否有特定品牌的显卡(也许是 Quadro?)可以在改变主机操作系统的情况下做到这一点?
I'm currently programming a scientific imaging application using OpenGL.
I would like to know if OpenGL rendering (in term of retrieved pixel from FBO) is supposed to be fully deterministic when my code (C++ / OpenGL and simple GLSL) is executed on different hardware (ATI vs NVidia, various NVidia generations and various OS)?
More precisely, I'd need the exact same pixels buffer everytime I run my code on any hardware (that can runs basic GLSL and OpenGL 3.0)...
Is that possible? Is there some advice I should consider?
If it's not possible, is there a specific brand of video card (perhaps Quadro?) that could do it while varying the host OS?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您通读 OpenGL 规范,就会发现必须满足许多确定性条件才能使实现符合标准,但也有大量的实现细节尚未实现完全取决于硬件供应商/驱动程序开发人员。除非您使用属于确定性/不变类别的令人难以置信的基本技术进行渲染(我相信这将使您无法使用过滤纹理、抗锯齿、照明、着色器等),否则该标准允许不同硬件甚至不同驱动程序之间存在相当大的差异在相同的硬件上。
If you read through the OpenGL specification, there are a number of deterministic conditions that must be met in order for the implementation to comply with the standard, but there are also a significant number of implementation details that are left entirely up to the hardware vendor / driver developer. Unless you render with incredibly basic techniques that fall under the deterministic / invariant categories (which I believe will keep you from using filtered texturing, antialiasing, lighting, shaders, etc), the standard allows for pretty significant differences between different hardware and even different drivers on the same hardware.
来自 OpenGL 规范(版本 2.1 附录 A):
如果禁用所有抗锯齿和纹理,则很有可能在各个平台上获得一致的结果。但是,如果您需要抗锯齿或纹理或 100% 像素完美保证,请仅使用软件渲染:http://www.mesa3d.org/。 mesa3d.org/
From the OpenGL spec (version 2.1 appendix A):
If you disable all anti-aliasing and texturing, you stand a good chance of getting consistent results across platforms. However, if you need antialiasing or texturing or a 100% pixel-perfect guarantee, use software rendering only: http://www.mesa3d.org/
通过“确定性”,我假设您的意思是您所说的(而不是这个词的实际含义):您可以跨平台获得像素相同的结果。
不,没有机会。
您只需使用图形驱动程序应用程序中的设置即可更改从渲染中获得的像素结果。来自同一硬件的驱动程序修订版可能会改变您所获得的结果。
OpenGL 规范从未要求像素完美的结果。抗锯齿和纹理过滤尤其是模糊的部分。
By "Deterministic", I'm going to assume you mean what you said (rather than what the word actually means): that you can get pixel identical results cross-platform.
No. Not a chance.
You can change the pixel results you get from rendering just by playing with settings in your graphics driver's application. Driver revisions from the same hardware can change what you get.
The OpenGL specification has never required pixel-perfect results. Antialiasing and texture filtering especially are nebulous parts.