Sign in to follow this  
MarkS

In what order are the polygons in a VBO drawn?

Recommended Posts

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]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this