In what order are the polygons in a VBO drawn?
Yet another tile engine question...
Each tile map in my engine is composed of one or more tile layers. The naive way to do this is to draw tile layer 0 (the bottom-most layer) followed by layer 1 and so on by separate calls to glDrawArrays.
What I'd much rather do is combine all of them into a single VBO and simply draw that. The problem I see is that since I'm using alpha blending, depth testing is turned off. This precludes me from specifying separate z coordinates for each layer.
What I'm wondering is how the array is parsed and drawn. Is it done linearly, from element 0 to element n or by some other method? If I were to set tile layer 0 as elements 0 to a and layer 1 and elements a to b and so on, would the layers be drawn correctly?
[Edited by - maspeir on December 29, 2009 3:27:10 PM]
Primitives are drawn from the buffers in the order they appear in the arrays. Your layers would be rendered in the desired order.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement