Triangle drawing order in DirectX / OpenGL

Is the order of drawing triangles in the 3D API guaranteed the same as their order in the index buffer?

For example, if I have two overlapping triangles in one drawing call, and depth testing is disabled, will the first or second triangle be visible at the end?

Or do I need to issue separate calls to appeal to make sure that the second triangle appears at the top of the 1st?

+5
source share
1 answer

In OpenGL, the order is really preserved, so the painters algorithm can be used, for example, when rendering translucent geometry.

Direct3D I do not know for sure, but I would say that it is applied there.

+6
source

All Articles