3
$\begingroup$

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?

$\endgroup$

1 Answer 1

5
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.