OpenGL 4.1 和 3.1+,主要区别是什么? [英] OpenGL 4.1 and 3.1+, What are key differences?

查看:65
本文介绍了OpenGL 4.1 和 3.1+,主要区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 OpenGL 4 和 3 非常相似,尤其是 3.1 和 4.1.由于两者基本上是一起发布的,因此很难理解 OpenGL 4.0/4.1 的基本原理.

在以前的 OpenGL 版本中,次要版本向上递增,直到实质性更改累积到新的主要版本中.OpenGL 3.x 和 4.x 引入了向后不兼容的 API 更改,然后据说 OpenGL 3.2 和 3.3 是 3 系列的特定分支,不向前兼容,而 3.1 与 4.1+ 兼容

与 OpenGL 3.1 相比,OpenGL 4.1 提供哪些主要区别以保证它被归类为新的主要版本?

奖励:在任何情况下,与 GL3 或仅可访问性相比,任何差异是否都能提高性能?

<块引用>

一些基于答案的额外发现

<小时><块引用>

OpenGL 3.3 旨在补充 OpenGL 4.0,将尽可能多的功能整合到旧硬件中.在 OpenGL 3 和 4 之间选择,3.3 可能是更好的选择有时.4.1 增加了 GL ES 2.0 兼容性以及一些不错的功能.

<小时><块引用>

较大的工作流程差异之一是通过新的曲面细分着色器在管道中添加 GPU 编程步骤.另一个是要渲染到多个视口.我相信新的细节级别功能会改变我正在使用的工作流程,也许其他很多,尽管我还没有深入研究这个功能.

如果您发现任何误解或需要改进的地方,请告诉我.

<块引用>

主题演讲(显然在询问元时从答案中删除..暂时参考实际答案.)

附录 G - K 对于 OpenGL 3.1 功能通过 OpenGL 4.1功能

Khronos 集团OpenGL 4.0 的发布可能更容易阅读":)

  • 采样对象
  • 实例化数组和着色器
  • texture_cube_map_array 和 texture_gather

  • GLSL 4.0动态 LOD

  • shader_subroutinesample_shading
  • separate_shader_objects
  • 增加纹理/渲染缓冲区
  • 所需的尺寸
  • 64 位浮点 顶点属性
  • get_program_binary
  • +2 细分着色器

解决方案

如果您的问题是如何在 4.1 中更好地处理工作流",那么这根本不是 4.1 的内容.

首先,快速定义,以确保我们谈论的是同一件事.对我来说,工作流程"意味着 API 改进和提高性能的东西.这些不允许硬件做任何你以前做不到的事情;它们只是让程序员更轻松,或者让您获得更快的性能.

绝大多数 API 改进(不是基于新功能的改进)都可作为核心扩展用于 3.3 实现.由于它们是核心扩展,因此您甚至无需更改代码即可从 3.3 代码中删除ARB"后缀,以便在 4.1 代码中使用它们.这一切都只是有效.特别是,我在谈论程序分离(GL_ARB_separate_program_objects)和检索已编译程序的二进制文件(GL_ARB_get_program_binary).两者都在 3.3 硬件上受支持;NVIDIA 甚至将这些一直扩展到 GeForce 6xxx 芯片.

主要的例外是着色器子程序,它仅限于 4.x 硬件.然而,这个规范的规定很差,我不确定是否有人可以使用它,更不用说应该使用它了.它很复杂,有些令人困惑.

没有多少东西可以轻松用于提升 4.1 独有的性能.如果这对您来说是一个瓶颈,那么无绑定渲染 (GL_NV_vertex_buffer_unified_memory) 可能是最大的性能增强.正如您可能从名称中注意到的那样,它是 NVIDIA 扩展而不是核心.我确信 ARB 正在为未来规范中的核心功能开发一些与此不完全不同的东西.Bindless 并不是 4.x 硬件所独有的;再次,NVIDIA 将其一直扩展到 GeForce 6xxx 芯片.

4.x 中有一些东西可以增强硬件,但它们最终都围绕着某种形式的 GPGPU 工作.如果您从 OpenCL 生成渲染数据,间接渲染 (GL_ARB_draw_indirect) 将是一个很好的加速.Civilization V 已经展示了使用 GPGPU 技术(他们使用 DXCompute,但您也可以使用 OpenCL)来解压缩纹理的价值;这对加载性能有很大帮助,因为您不必从磁盘加载尽可能多的数据.

如果您想真正扩展性能改进的定义,可以将曲面细分视为一种性能增强.您可以使用它来发送较小的网格,或者使用靠近相机的较低 LOD 网格.或者,您可以将其视为一种渲染比以往更高的多边形网格的方法.

4.x 真的不是要提供让事情进展得更快的硬件功能.更重要的是能够以与以前不同的方式进行渲染.

还有一件事:在 3.1 和 3.3 之间没有选择.几乎所有可以运行 3.1 的硬件都可以运行 3.3.如果没有,那是因为硬件制造商在他们的 OpenGL 驱动程序上懈怠了(我在看着你,英特尔).

I understand that OpenGL 4 and 3 are fairly similar, especially 3.1 and 4.1. With both being essentially released together, it can be difficult to understand the rationale for OpenGL 4.0/4.1.

In previous releases of OpenGL, minor version increments upward until substantial changes accumulated into a new major version. OpenGL 3.x and 4.x introduced backwards-incompatible API changes and then OpenGL 3.2 and 3.3 are said to be specifically branches of the 3 series which are not forward compatible while 3.1 is compatible with 4.1+

What key differences does OpenGL 4.1 offer compared with OpenGL 3.1 that warrant it to be classified under a new major version?

Bonus: Do any of the differences provide performance increases in any situations over GL3 or just accessibility?

Edit: Some extra findings based on answers


OpenGL 3.3 was made to compliment OpenGL 4.0 to incorporate as much of the functionality as they could into older hardware. Choosing between OpenGL 3 and 4, 3.3 may be a better choice sometimes. 4.1 has added GL ES 2.0 compatibility however and some nice features.


One of the bigger workflow differences would be added GPU programing steps in the pipeline via the new tessellation shaders. Another would be multiple viewports to render to. I believe the new level of detail feature would change the workflow I'm using and perhaps other quite a bit, though I have not looked into this feature in depth.

Please let me know if you see any misconceptions or areas to improve.

Keynotes (apparently removed from answer while asking on meta.. For temporary reference of what the actual answer was.)

Appendix G - K For OpenGL 3.1 features through OpenGL 4.1 features

Khronos Group Release Of OpenGL 4.0 may be "easier to read" :)

  • Sampler Objects
  • Instanced Arrays and Shaders
  • texture_cube_map_array and texture_gather

  • GLSL 4.0 and dynamic LOD

  • shader_subroutine and sample_shading
  • separate_shader_objects
  • Increase required sizes for texture/renderbuffers
  • 64 bit floating point vertex attributes
  • get_program_binary
  • +2 Tesselation shaders

解决方案

If your question is "How can the workflow be better in 4.1", that's simply not what 4.1 is about.

First, a quick definition, to make sure we're talking about the same thing. For me, "workflow" means API improvements and things that make performance better. These don't allow the hardware to do anything you couldn't before; they just make it easier for the programmer or let you get faster performance.

The vast majority of the API improvements, the ones that aren't based on new features, are available to 3.3 implementations as core extensions. Since they are core extensions, you don't even have to change your code to remove the "ARB" suffix from your 3.3 code to use them in 4.1 code. It all just works. In particular, I'm talking about program separation (GL_ARB_separate_program_objects) and retrieving binaries of compiled programs (GL_ARB_get_program_binary). Both are supported on 3.3 hardware; NVIDIA even extends these all the way back to GeForce 6xxx chips.

The main exception to this is shader subroutines, which is limited to 4.x hardware. However, this specification is so poorly specified that I'm not sure that anyone even can use it, let alone should. It is convoluted and somewhat confusing.

There isn't much that one could easily use to boost performance that is unique to 4.1. Bindless rendering (GL_NV_vertex_buffer_unified_memory) is probably the biggest performance enhancement if that is a bottleneck for you. As you probably noticed from the name, it is an NVIDIA extension and not core. I'm sure the ARB is working on something not entirely unlike this for a core feature in a future spec. And Bindless isn't unique to 4.x hardware; again, NVIDIA extends this all the way back to GeForce 6xxx chips.

There are some things in 4.x that can enhance hardware, but they all ultimately revolve around some form of GPGPU work. Indirect rendering (GL_ARB_draw_indirect) would be a good speedup if you are generating rendering data from OpenCL. And Civilization V has already shown the value of using GPGPU technologies (they use DXCompute, but you could do it with OpenCL too) to decompress textures; this helps tremendously in loading performance, as you don't have to load as much data from disk.

If you want to really stretch the definition of performance improvement, Tessellation could be considered a performance enhancement. You could use it to send smaller meshes, or use your lower LOD meshes closer to the camera. Or you could consider it a way to render higher polygon meshes than you ever could before.

4.x really isn't about providing hardware features that make things go faster. It's more about being able to render in different ways than you could before.

And one more thing: there isn't a choice between 3.1 and 3.3. Pretty much any hardware that could run 3.1 can run 3.3. If it doesn't, then that's because the hardware maker is slacking off on their OpenGL drivers (I'm looking at you, Intel).

这篇关于OpenGL 4.1 和 3.1+,主要区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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