Is there a max size for vertex buffer objects binded to GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER???
Originally, I was drawing a mesh composed of 16 submeshes. For each submesh, I created a vertex buffer and during the rendering phase, I called glDrawElements. This worked fine on the iOS simulator, but when I tried to render to my device, the screen flashes constantly and the meshes aren't displayed.
I then did some reading and found that you shouldn't call glDrawElements too many times during a render phase. I tried to combine all of my submeshes into one vertex buffer. The buffer bound to GL_ARRAY_BUFFER contains 3969 vertices, where each vertex contains 20 floats. So the size of this buffer is 317520 bytes. The indices bound to GL_ELEMENT_ARRAY_BUFFER are 16425 shorts. The size of this buffer is therefore 32850 bytes.
On the OpenGL wiki, it says that "1MB to 4MB is a nice size according to one nVidia document" for a Vertex Buffer Object.
I printed out the result of glGetError after binding each buffer object, and calling glDrawElements, and I don't see any errors. However, my meshes aren't correctly displayed. It seems as though only the first mesh gets correctly drawn. Is there anything fishy in the way I've implemented this? I didn't want to make this question too long so if there's any extra information you need to answer this question let me know. If there's nothing in theory that seems wrong, perhaps I've just made a mistake in implementing it.
There is a maximum size, in the sense that the GPU can always issue a GL_OUT_OF_MEMORY error. But other than that, no.
See this:
http://www.sunsetlakesoftware.com/2008/08/05/lessons-molecules-opengl-es
There are some natural limits using smaller data types, like obviously ~65000 for using shorts as indexes.
But more importantly there is some additional help in the link, which is a very good tutorial, and includes some anecdotal evidence that shorts up to the natural functional limit work.
I know it is too late to answer this question. However, I wish the answer helps someone!
Based on The Specification of OpenG Graphics System (Version 4.5 (Core Profile) - May 28, 2015), it states: "There is no limit to the number of vertices that may be specified, other than the size of the vertex arrays." please see page 322.
Sorry, also as Nicol Bolas mention here: https://stackoverflow.com/a/7369392/4228827
Cheers, Naif
来源:https://stackoverflow.com/questions/7369238/max-size-for-vertex-buffer-objects-opengl-es-2-0