OpenGL: is it more efficient to use GL_QUADS or GL_TRIANGLES?

I know that OpenGL is deprecated and got rid of GL_QUADS in new versions. I heard that this is due to the fact that modern GPUs only display triangles, so calling the ATV will just make the GPU complicate the work on two triangles (which I heard in any case, I'm not an expert on any of this topic).

I was wondering if it’s better or not (provided that the average human processor is faster than their GPUs), it simply manually breaks the quadrant rendering into two triangles on its own or simply allows the GPU to do it itself. Again, I have absolutely no experience with OpenGL as I am just getting started. I would rather know what is best for most cars these days, so I could focus on the rendering method *. Thanks.

* However, I will probably use the "triangle method" for this.

+4
source share
2 answers

Even if you load OpenGL quadrants, the triangle is executed by the driver on the processor side before it even gets on the GPU. Modern GPUs these days eat nothing but triangles. (Well, the lines and dots.) So, something will triangulate, whether you or the driver - it does not really matter where this happens.

This will be less efficient if, say, you do not reuse vertex buffers, and instead re-fill them again with quads (in this case, the driver will have to re-initialize each vertex buffer), instead of the pre-processed triangles, but this is rather far-fetched (and the problem you have to fix in this case is only that you replenish vertex buffers).

I would say, if you have a choice, stick to the triangles, since this is that most content pipelines are laid out anyway, and you are less likely to encounter problems with non-planar ATVs and the like. If you want to choose the format that your content is in, then for sure use triangles, and the triangulation step will be skipped altogether.

+7
source

Any geometry can be represented by triangles, and therefore it was decided to use triangles instead of quads. Another reason is that two triangles do not have to be coplanar, which is not true for ATVs.

Yes, you choose to render quads, but the driver converts the quadrant into two triangles.

Therefore, choosing to render an ATV will not work less with the GPU, but will make your processor bigger because it needs to do the conversion.

+1
source

All Articles