for learning purposes I decide to draw a sphere using 3 methods
- Display List
- Voa Vbo (GL_TRIANGLE_STRIPE)
- Vao Vbo and Ibo (GL_TRIANGLES)
I read that using ibo makes program runs faster, but is this really true? For a sphere of 100 slices and 100 stacks 2nd method produces 40400 vertices while 3rd "only" 19802.By doing that I save 20598vertices each 32bytes = 659136 bytes.
verticesSize=(slices*4)*(stacks+1);
IBO verticesSize=(slices*2)*(stacks-1)+2;
However I need to make array of indices which in this case is a size of 118800(number of indexes needed to create all faces)*4(size of unsigned int)=475200 bytes! While 2nd methods renders 1000 spheres with 15fps ,the 3rd renders 1000 with barely 6pfs
- Does converting indices array from GL_TRIANGLES to GL_TRIANGLE_STRIP will provide more efficiently method then 2nd method?
- Does rendering sphere using ibo is bad idea?
- Why it is slower?Does the order in indices array have any matter?
Or maybe I wrote my code completely wrong and that why it struggles so much :( If someone is interested ,here is my code http://pastebin.com/raw.php?i=74jLKV5M