Hi, I am working on water surface simulation and I am using glDrawELements() for laying my triangular mesh.
The problem is, maximum vertices the code works is 62500(i.e when I lay a 250x250 grid). If I increase the grid size above this for eg 260x260 or 300x300 the grid gets stripped for right side and only 62500 vertices are drawn. Also the grid appears not laid properly.
link for 250x250 grid simulation image:
http://www.flickr.com/photos/37679557@N03/5579269742/
link for 350x350 grid simulation image:
http://www.flickr.com/photos/37679557@N03/5579270484/
I am using GL_TRIANGLES for putting the triangles. I have used the query command
glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, &maxVertices);
which gives the output 1048576, and the max i can use is 62500 so I can still increase lot of vertices.
I had googled about this problem but all I found was to use GL_MAX_ELEMENTS_VERTICES and act accordingly. following is part of my code:
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(GL_FLOAT, 0, normals);
glTexCoordPointer(2,GL_FLOAT,0,tex);
glVertexPointer(3,GL_FLOAT,0,vertices);
glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, &maxVertices);
glGetIntegerv(GL_MAX_ELEMENTS_INDICES, &maxIndices);
glDrawElements(GL_TRIANGLES,6*(n-1)*(n-1),GL_UNSIGNED_SHORT,indices);
glDisableClientState(GL_VERTEX_ARRAY);
where ‘n’ is the height or width of square grid.
Thanks in advance.