3

In my simulation I draw a bunch of rectangles with GL_TRIANGLE_STRIP inside of one draw call.

What will happen if I turn off GL_DEPTH_SORT? If all of the rectangles were stacked on top of themselves in a 2D screenspace sense would they always be in the same order?

I'm assuming it's just like when you do multiple draw calls (the first one is in back, the last one is in front) how it essentially just draws over what was previously drawn.

I am using OpenglES 2.0.

Also what happens with blend modes? Let's say I am doing additive blending, and then multiply the colors by 0.5 making them transparent. Would additive blending work?

J.Doe
  • 1,445
  • 12
  • 23

1 Answers1

5

If depth testing is disabled, the triangles get drawn in the order they're submitted, i.e. the order they appear in the index buffer or vertex buffer. Later ones will overwrite earlier ones, or blend over them if blending is enabled. This ordering is guaranteed by all GPUs and APIs as far as I know.

Nathan Reed
  • 25,002
  • 2
  • 68
  • 107