Minimizing glDrawArray calls in OpenGls

I would like to hear what people think is the best call to call for Open GL ES (on iphone).

In particular, I have read in many places that it is best to minimize the number of calls to glDrawArrays / glDrawElements - I think Apple says 10 should be maximum in their recent WWDC presentation. As I understand it, for this you need to put all the vertices in one array, if possible, so you only need to call drawArrays once.

But I am confused, because this certainly means that you cannot use the translation, rotation, and scaling functions, because this applies to all geometry. Which is good, but does this not mean that you need to pre-calculate each position of the vertices yourself, and not open gl?

Also, doesn't that mean you cannot use any fan / strip settings unless you have a permanent shape?

These shortcomings make me think that I do not understand something correctly, therefore, I think I am looking for confirmation that I should:

  • Try making an uber array of all triangles for drawing.
  • Accept the fact that I myself have to work out all the vertex positions.
  • Forget about push'ing and pop'ing of each thing to draw the desired location in it.

Is that what others do?

thank

+3
source share
1 answer

The big question is, dosing is always a compromise.

, , , .

:

  • , 16 , , , . 65536 .

  • , //glState , (*), //glState. , shaderID/materialID/glStateID.

  • , , (*), GL, . ", , , , .

( CPU), .

, , , . , , .

, - , 3d-, 3d-. IMHO, , , .

HTH, ,


(*) , , :

  • , , GL,

  • () , mesh -.

  • ...

+8

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


All Articles