What's wrong with GL_QUADS?

I heard that GL_QUADS will be removed in OpenGL versions> 3.0, why? Will my old programs work in the future? I tested, and GL_TRIANGLES or GL_QUADS have no difference in rendering speed (maybe even faster than GL_QUADS ). So what is the point?

+56
deprecated opengl
Jul 10 '11 at 10:15
source share
3 answers

The fact is that your GPU displays triangles, not quads. And it's almost trivial to build a rectangle of two triangles, so the API really does not need to be burdened with the possibility of rendering squares. OpenGL goes through a major cropping process, reducing a ton of functionality that made sense 15 years ago, but no longer matches how the GPU works, or how the GPU will ever work. I believe that the fixed-function pipeline has also disappeared from the latest versions, because, again, it is no longer needed, and it no longer matches the way the GPU (programmable shaders) works.

The fact is that the smaller and more complex the OpenGL API, the easier it is for sellers to write reliable, high-performance drivers, and the easier it is to learn how to correctly and efficiently use the API.

A few years ago, almost everything that was in OpenGL could be done in three different ways, which would put a lot of work on the developer to figure out which implementation is right if you want optimal performance.

Therefore, they are trying to optimize the API.

+68
Jul 10 2018-11-22T00:
source share

This is not "something." As with many other functions, GL_QUADS deprecated in version 3.0 and removed in version 3.1. Obviously, this does not matter if you are creating a compatibility context.

Any answer that anyone can give due to depreciation will be a clear prerequisite.

+8
Jul 10 '11 at 10:18
source share

People have already answered your question pretty well. In addition to their answer, one of the reasons GL_QUADS is deprecated is due to the nature of quads undefined.

For example, try modeling a 2d square with points (0,0,0), (1,0,0), (1,1,1), (0,1,0) . This is a flat ATV with a drag of one corner. Thus, it is impossible to make a NORMAL flat square. Depending on the drivers, it will be divided into two triangles, one or the other, which we cannot control. Such a model MUST be simulated with two triangles. - All three points of the triangle always lie on the same plane.

+7
Nov 09 '15 at 7:02
source share



All Articles