使用哪个版本的 OpenGL?
我目前运行的机器允许我使用 OpenGL 2.1 进行编程。如果我要制作一个程序,我应该使用当前 OpenGL 版本(如 3.x/4.x)的功能还是使用 2.1?
附带问题:我如何知道我的计算机可以运行的 OpenGL 最高版本是什么?
另一方面的问题是:仅升级我的显卡才允许我在升级版本的 OpenGL 中进行编程吗?
I currently run a machine that allows me to program in OpenGL 2.1. If I were to make a program, should I use the power of the current OpenGL versions like 3.x/4.x or use 2.1?
On a side question: How can I tell what's the highest version of OpenGL my computer can run?
On another side question: does only upgrading my video card allow me to program in upgraded versions of OpenGL?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
OpenGL 版本(适用于 AMD 和 NVIDIA GPU)大致对应于硬件级别。 2.x OpenGL 版本适用于 DX9 级别的硬件。 3.x代表DX10级别,4.x代表DX11级别硬件。因此,您选择的版本限制了您可以运行的代码。
一般来说,您实际上可以从商店购买的任何 AMD 或 NVIDIA GPU 都将是 3.x 或更好(很可能是 4.x)。即使是 AMD 的集成 GPU、主板或 CPU 也是 3.x 或更高。我在 HD 3300 主板 GPU 上做了一些家庭开发工作,它运行得相当不错。
英特尔是个问题。 Intel 的 OpenGL 驱动程序质量相当差。许多旧的 Intel 机器只能支持 GL 1.4,这是 DX9 之前级别的功能。它们确实支持一些更高级别的扩展(着色器,但仅限顶点着色器,因为它们在软件中运行)。
最新的 Intel GPU 稍好一些,但它们的 GL 驱动程序仍然有很多问题。
上面描述的是Windows的情况。 Linux 有点模糊,因为有来自 NVIDIA/AMD 的驱动程序,也有开源社区编写的驱动程序。后者总体上不太好,但正在改善。这些往往适用于 3.x 级硬件。
MacOSX 世界有点不同。最近发布的 Mac OSX Lion (10.7) 增加了对 OpenGL 3.2 的支持(遗憾的是,由于某种原因,不是 3.3)。 Apple 严格控制 OpenGL 在其平台上的工作方式,但希望他们能够比最近更频繁地更新 GL 版本。
因此,在 Mac 上,您实际上有两个选择:2.1 或 3.2。请注意,Lion 的 3.2 支持仅公开核心 OpenGL 功能。有关其含义的详细信息,请参阅此页面。
您无法判断您的特定计算机能够支持的最高版本。这只是您创建上下文时获得的版本。一般来说,除非您特别要求版本(即使如此,通常也不会),您将获得硬件和驱动程序可以处理的最高版本。
哦,是的:OpenGL 版本由您的显卡功能(和安装的驱动程序)控制。
以下建议假设您正在开发一个供其他人使用的严肃应用程序。这不适用于小型演示应用程序或其他任何东西。
一般来说,我建议不要明确地将代码限制为 4.x。虽然 4.x 的采用率每天都在增加(NVIDIA 和 AMD 都有 2 代硬件支持 4.x,AMD 可能会在年底前推出第三代硬件。此外,AMD 开始嵌入支持 4.x 的 GPU现在在他们的 CPU 中),仍然有很多 3.x 硬件。 4.x 不会给您带来太多好处,您可以轻松添加代码路径以有条件地支持 4.x 功能(如果可用)。
OpenGL versions (for AMD and NVIDIA GPUs) roughly correspond to levels of hardware. 2.x OpenGL versions are for DX9-level hardware. 3.x represents DX10-level, and 4.x represents DX11-class hardware. So the version you pick restricts you can run your code.
In general, any AMD or NVIDIA GPU you can actually buy new from a store will be 3.x or better (more than likely, 4.x). Even integrated GPUs, motherboard or CPU, from AMD are 3.x or better. I do some home development work on an HD 3300 motherboard GPU, and it works reasonably well.
Intel is a problem. Intel's OpenGL driver quality is pretty poor. Many old Intel machines can only support GL 1.4, which is pre-DX9 class functionality. They do support some higher-level extensions (shaders, but only vertex shaders, since they run them in software).
More recent Intel GPUs are a bit better, but their GL drivers are still rather buggy.
The above describes the situation for Windows. Linux is a bit fuzzier, because there are drivers from NVIDIA/AMD, and open-source community written drivers. The latter are generally not as good, but they are improving. These tend to be for 3.x-class hardware.
The MacOSX world is a bit different. Mac OSX Lion (10.7), recently released, adds support for OpenGL 3.2 (sadly, not 3.3, for some reason). Apple rigidly controls how OpenGL works on their platform, but hopefully they will be updating GL versions more frequently than they have been recently.
So on Macs, you really have two choices: 2.1 or 3.2. Note that Lion's 3.2 support only exposes core OpenGL functionality. See this page for details on what that means.
You cannot tell what the highest version your particular computer is capable of. There is simply the version you get when you create a context. In general, unless you specifically ask for a version (and even then, usually not), you will get the highest version your hardware and drivers can handle.
Oh, and yes: the OpenGL version is controlled by your video card's capabilities (and installed drivers).
The following advise assumes that you're developing a serious application that you intend for others to use. This isn't for little demo apps or whatever.
In general, I would advise against explicitly restricting your code to 4.x. While 4.x adoption increases every day (there are 2 hardware generations from both NVIDIA and AMD with 4.x support, and a third likely will be out by years end from AMD. Also, AMD is starting to embed 4.x capable GPUs in their CPUs now), there is still a lot of 3.x hardware. 4.x doesn't buy you a whole lot, and you can easily add code paths to conditionally support 4.x features if they are available.
为了使用 OpenGL 3.x,您需要一张支持 DirectX10 的卡以及支持它的适当驱动程序。
与 DirectX 相反的优点是,您还可以在 WindowsXP 上使用 OpenGL3 和 4。不需要 7 或 Vista。
您应该使用哪个版本取决于您的受众。如果您的受众是游戏玩家,请继续使用 3。还不会独占 4。 DX11还是很少见的。
要初步了解游戏玩家如何使用他们的计算机以及他们拥有的硬件,steam 是一个很好的来源:
http://store .steampowered.com/hwsurvey
您可以通过运行来确定版本:
一个好的 OpenGL3 教程:
http://arcsynthesis.org/gltut/
OpenGL 3.3 SDK 参考:
http://www.opengl.org/sdk/docs/man3/
希望这会有所帮助:)。
In order to use OpenGL 3.x you need a card that supports DirectX10 and proper drivers that have support for it.
The advantage in opposite to DirectX is, that you can also use OpenGL3 and 4 on WindowsXP. No need for 7 or Vista.
Which version you should use depends on your audience. If your audience are gamers, go ahead, use 3. Won't do 4 exclusive yet. DX11 are still rare.
For a first look on how Gamers use their computers and what hardware they have, steam is a good source:
http://store.steampowered.com/hwsurvey
You can determine the version by running:
A good OpenGL3 Tutorial:
http://arcsynthesis.org/gltut/
The OpenGL 3.3 SDK Reference:
http://www.opengl.org/sdk/docs/man3/
Hope this helps a bit :).
许多嵌入式 Intel 显卡仅限于 1.4 或 1.5。
我听说 Mac OSX 停留在 2.1 上。
所有 Radeon 和 GeForce 卡都可以执行 3+(可能需要驱动程序更新)。
您可以使用任何版本进行编程,但如果您的硬件不支持它,您最终将在软件渲染器下进行测试(速度很慢!)。
Lots of embedded Intel graphics are limited to 1.4 or 1.5.
Mac OSX is stuck on 2.1 I hear.
All Radeon and GeForce cards can do 3+ (may need a driver update).
And you can program with any version, but if your hardware doesn't support it, you'll end up testing under a software renderer (slow!).
我针对上述问题进行回答。
我遇到了下面的工具,它本身非常完整,让我看到我的系统当前支持的所有 OpenGL 版本(从 1.0 到它实际支持的版本)。以及可供我的系统使用的扩展。不仅适用于 ARB,还包括 NV、ATI、OES 等。
http:// www.realtech-vr.com/glview/download.html
I answer for the above question.
I come across to the tool below, it's really complete in itself and let me see all OpenGL version that my system currently support (from 1.0 up to what it actually support). As well for extensions available for my system to use. Not only for ARB though, it ranges from NV, ATI, OES, etc.
http://www.realtech-vr.com/glview/download.html