android - Batching Multiple Rectangles in OpenGL ES -
i experiencing slow performance iterating through quad triangle strips , drawing each 1 separately, batch of rectangles 1 single draw call.
looking around, seems best way occur overhead of duplicating vertices , using gl_triangles instead of gl_triangle_strip, drawing 2 separate triangles each rectangle.
the problem each rectangle can have different color, , need programmatically change color of of rectangles. using 1 gl_triangles call not trick. instead, looks i'll need somehow index color data vertex data, associating color each rectangle. how go this?
thank you!
you can use vertex coloring.
vertices can each have multiple channels of data, including position, color, (multiple) texture, normal, , more.
i recommend interleaving vertices include position , color 1 after other, directly. although can set separate array of colors , way (just make sure line colors positions correctly).
(those tutorials iphone-oriented opengl es code should work fine on android)
Comments
Post a Comment