Optimization of the OpenGL ES application. Should I avoid calling glVertexPointer whenever possible?

I am developing a game for the iPhone in OpenGL ES 1.1; I have many textured squares in the data structure, where each node has a list of child nodes. Therefore, I cross the structure from the root and render each quad, then its children, etc.

The fact is, for each square, I call glVertexPointer to set the vertices.

  • Should I avoid calling it for each square? Will it improve performance only once?
  • Does glVertexPointer copy vertices to GPU memory or just save a pointer?

Trying to minimize the number of calls will not be easy, as each node can have different quadrants. I have many equal sprites with the same vertex data, but I do not have to show them one by one, since I can draw another sprite between them.

Thank.

+3
source share
1 answer

glVertexPointer , OpenGL , . , " , , ", , , . , , . , , , , . , glVertexPointer (, , glDrawArrays glDrawElements?) , .

, , , , , glVertexPointer . glVertexPointer ( , ) . , parallelism / .

NDA, - Xcode 4. Apple , , OpenGL ES. , .

GPU, . glGenBuffers, glBufferData glVertexPointer , . 0, , , . ES 1.x GL_DYNAMIC_DRAW, , . , , , , , .

- ES 2.x, GL_STREAM_DRAW, , . , , , , Google , OpenGL. ES 1.x - GL_STATIC_DRAW GL_DYNAMIC_DRAW.

iPad ES 1.x , , . , 40 , VBO 20% .

+10

Source: https://habr.com/ru/post/1787705/


All Articles