GL_QUADS有什么不好的地方? [英] What is so bad about GL_QUADS?

查看:276
本文介绍了GL_QUADS有什么不好的地方?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说GL_QUADS将在OpenGL版本> 3.0中删除,这是为什么呢?将来我的旧程序会无法运行吗?我已经进行了基准测试,并且GL_TRIANGLESGL_QUADS的渲染速度没有差异(甚至可能是GL_QUADS更快).那有什么意义呢?

I hear that GL_QUADS are going to be removed in the OpenGL versions > 3.0, why is that? Will my old programs not work in the future then? I have benchmarked, and GL_TRIANGLES or GL_QUADS have no difference in render speed (might even be that GL_QUADS is faster). So whats the point?

推荐答案

重点是您的GPU渲染三角形,而不是四边形.从两个三角形构造一个矩形几乎是不重要的,因此,API不必真正具有原生渲染四边形的能力. OpenGL正在经历一个重大的修整过程,削减了15年前有意义的许多功能,但不再匹配GPU的工作方式或GPU的工作方式.我相信,固定功能管道也从最新版本中删除,因为再次不再需要固定功能管道,并且它不再与GPU的工作方式(可编程着色器)匹配.

The point is that your GPU renders triangles, not quads. And it is pretty much trivial to construct a rectangle from two triangles, so the API doesn't really need to be burdened with the ability to render quads natively. OpenGL is going through a major trimming process, cutting a lot of functionality that made sense 15 years ago, but no longer match how the GPU works, or how the GPU is ever going to work. The fixed function pipeline is gone from the latest versions too, I believe, because, once again, it's no longer necessary, and it no longer matches how the GPU works (programmable shaders).

问题在于,可以使OpenGL API变得更小,更紧密,供应商更容易编写健壮的高性能驱动程序,并且更容易学习正确有效地使用API​​.

The point is that the smaller and tighter the OpenGL API can be made, the easier it is for vendors to write robust, high-performance drivers, and the easier it is to learn to use the API correctly and efficiently.

几年前,几乎所有OpenGL中的东西都可以用3-5种不同的方式完成,这给开发人员带来了很多负担,使他们无法确定哪种实现是正确的.最佳性能.

A few years ago, practically anything in OpenGL could be done in 3-5 different ways, which put a lot of burden on the developer to figure out which implementation is the right one if you want optimal performance.

因此,他们正在尝试简化API.

So they're trying to streamline the API.

这篇关于GL_QUADS有什么不好的地方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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