Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A question about GL_VERTEX_ARRAY

This is just out of mere interest, but is there a limit to the amount of vertecies GL_VERTEX_ARRAY will 'hold' and render through something like drawArrays()? Or could I theoretically pass through a few million vertexes and still be able to call drawArrays()?

like image 503
MPainter Avatar asked Sep 23 '26 15:09

MPainter


1 Answers

Since OpenGL-1.2 a sort of limitation applies when using glDrawRangeElements:

Implementations denote recommended maximum amounts of vertex and index data, which may be queried by calling GetIntegerv with the symbolic constants MAX_ELEMENTS_VERTICES and MAX_ELEMENTS_INDICES. If end-start+1 is greater than the value of MAX_ELEMENTS_VERTICES, or if count is greater than the value of MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no requirement that all vertices in the range start; end be referenced. However, the implementation may partially process unused vertices, reducing performance from what could be achieved with an optimal index set.

But that's more of a recommendation, that a hard constraint. Other than that, the true limit is the amount of memory installed, and what can be addressed by the chosen type for the index element array

However the limits for glDrawRangeElements usually also make a good indication for batch sizes in general.

like image 125
datenwolf Avatar answered Sep 28 '26 17:09

datenwolf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!