Imagination PowerVR SDK Blog

glDrawElements with GL_UNSIGNED_BYTE


#1

Hi there,





In order to reduce the vertex bandwidth in our title, I check to see if the number of indices in a vertex buffer is < 256. If so, I create a VBO with byte indices.





When it comes to rendering, I check the number of indices, if < 256 I use:





glDrawElements(GL_TRIANGLES,n,GL_UNSIGNED_BYTE, 0);





otherwise I use:





glDrawElements(GL_TRIANGLES,n,GL_UNSIGNED_SHORT, 0);





This reduction of bandwidth actually reduces my framerate by about 5%! :frowning:


Are the byte elements getting converted to shorts in the driver or something?





Thanks,





Steve.