我应该学习哪个版本的 OpenGL?

发布于 2024-12-10 16:14:36 字数 320 浏览 0 评论 0原文

可能的重复:
使用哪个版本的 OpenGL?

我一直想学习 3D 图形语言已经有一段时间了,我终于决定学习OpenGL。 然而,我在Mac上工作,官方的OpenGL for mac最高版本是2.1,但通过我所做的测试,它可以非官方地支持3.3。

我想开发可在多个平台上运行的应用程序,但最好学习哪个版本?

Possible Duplicate:
Which version of OpenGL to use?

I have been wanting to learn a 3d graphics language for some time now and I have finally decided to learn OpenGL.
However, I work on a Mac and officially this highest version of OpenGL for mac is 2.1 but it can support 3.3 unofficially through tests that I have done.

I would like to develop applications that would work on multiple platforms but what version would be the best to learn?

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

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

发布评论

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

评论(3

玩心态 2024-12-17 16:14:36

可移植性和仍然学习“现代 OpenGL 方式”之间的一个很好的折衷方案大致是“OpenGL 2.1 的 OpenGL ES 2.0 子集”。这使您可以移植到

  • OSX,正如您提到的

  • Windows,显然

  • 具有开源驱动程序的Linux(用于更高的OpenGL版本和更好的 人喜欢避免使用这些驱动器)

  • 智能手机平台,如 iOS 和Android。

OpenGL 1.x 更加可移植(例如,旧版 iOS 和 Android 版本仅支持 OpenGL ES 1.x),但经典的固定功能编程模型与基于缓冲区对象和着色器以及立即模式使用的现代编程模型有些不同渲染大量顶点时很容易导致性能问题。所以可能不值得,恕我直言。

A good compromise between portability and still learning the "modern OpenGL way", is roughly "the OpenGL ES 2.0 subset of OpenGL 2.1". That gives you portability to

  • OSX, as you mention

  • Windows, obviously

  • Linux with open source drivers (for higher OpenGL versions and better performance you need the proprietary drives which you might prefer anyway, but some people like to avoid those)

  • Smartphone platforms like iOS and Android.

OpenGL 1.x is even more portable (e.g. older iOS and Android releases support only OpenGL ES 1.x) but the classical fixed-function programming model is somewhat different than the modern one based on buffer objects and shaders, and use of immediate mode easily leads to performance issues when rendering lots of vertices. So probably not worth it, IMHO.

救赎№ 2024-12-17 16:14:36

我的建议是学习不少于版本3.2。如果支持 3.3(即使是非官方的),那就支持吧。

OpenGL 3.3 已经是“最后一代”而不是“前沿”。您必须努力搜索才能找到支持 OpenGL 3.3 的卡,并且您可以在 30 美元的范围内获得支持 4.x 的卡。

在 2.x 版本下,您必须经历很多痛苦才能确保即使是您每天使用的最基本的功能也可用,并且您最终会编写两到三个代码路径,具体取决于您必须使用什么扩展以及什么有一些限制。
在 3.3 版本下,您每天想要使用的大多数功能都是核心(保证标准),并且大多数限制都有一个保证的最小值,无论如何对于大多数事情来说都足够了。 3.3 中非核心的功能很少(如果没有它们,你也不会死),如果有的话,你几乎可以选择将它们插入,如果有,就忘记它们。 t。

2.1 和 3.3 之间的范式发生了巨大的变化(如果您先从 2.x 开始,稍后您将不得不重新学习!),并且 GLSL 在 3.1 和 3.2 之间也发生了显着的变化,这使得编写可以工作的着色器代码这既是一种考验,又是不可能的。
3.2版本以上,一切顺利。新功能可用或不可用……使用或不使用它们……但原则上您可以编写一段代码来在所有版本上运行。

My recommendation would be to learn no less than version 3.2. If 3.3 is supported (even unofficially), go for that.

OpenGL 3.3 is already rather "last generation" than "bleeding edge". You have to search hard to find a card that does not support OpenGL 3.3, and you get 4.x capable cards in the $30 range.

Under version 2.x, you must go through a lot of pain to ensure that even the most basic functionality that you use every day is available, and you end up writing two or three code paths depending on what extension you must use and on what some limit is.
Under version 3.3, most features that you want to use every day are core (guaranteed standard), and most limits have a guaranteed minimum value that is enough for most things anyway. The features that are not core in 3.3 are few (and you won't die if you don't have them), and you can pretty much just plug them in optionally if they're there, and forget about them if they aren't.

There is a huge change in paradigms between 2.1 and 3.3 (which you will have to re-learn later if you start with 2.x first!), and there are notable changes in GLSL between 3.1 and 3.2 which make writing shader code that works for both an ordeal, or impossible.
Upwards of version 3.2, everything is smooth. New features are available or they aren't... use them or don't... but you can in principle write one piece of code to run on all versions.

雅心素梦 2024-12-17 16:14:36

如果您的目标是最大程度的互操作性,我宁愿看看 WebGL,或者它的近亲,< a href="http://www.khronos.org/opengles/" rel="nofollow">OpenGL ES。 OpenGL ES 的概念(至少在 2.0 版本中)与 OpenGL 4 的概念非常接近(基于缓冲区的数据传输、通用着色器等)。

我认为通过学习 2.1,你会学到一些过时的概念,你很快就必须重新学习,比如直接模式,或者更确切地说整个 固定功能管道,在以后的版本中被删减。

您也可以安全地开始学习 3.x,因为您将了解当前的概念和功能。不用担心“官方支持”的版本。

If your goal is maximum interoperability, I would rather take a look at WebGL, or it's close relative, OpenGL ES. The concepts of OpenGL ES (at least in the 2.0 version) are quite close to those of OpenGL 4 (buffer-based data transfer, universal shaders etc.).

I think that by learning 2.1 you would learn some outdated concepts you will soon have to re-learn, like the direct mode, or rather the whole fixed-function pipeline which was pruned in later versions.

You can safely start learning the 3.x too, as you will learn the current concepts and features. Do not worry about the "officially supported" version.

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